command line interface - What's the fastest way to run multiple php CLI? -


i need move lot of mysql rows couchbase server. catch need use php class job (the class has business logic)

i've created php cli script , ran 6 of them @ once. it's faster running single cli script, not enough. took me 2 hours transfer everything.

are there better way?

updated:

what php code mysql

  1. select * table limit $limit

that's it. nothing fancy.

are there better way?

yes. there is.

you need identify bottleneck. describe seems bottleneck number of jobs run in parallel. should increase until find maximum performance. gnu parallel can that.

when have done that, bottleneck somewhere else. since description has little detail, impossible tell where.

you therefore have find new bottleneck. bottleneck typically disk i/o, network i/o, or cpu, can shared lock or other ressource.

to cpu bottleneck run top. if see process running @ 100% , cannot parallelize process, have found bottleneck.

to disk i/o bottleneck run iostat -dkx 1. if last column hits 100% more 50% of time, have found bottleneck.

to network i/o bottleneck run iotop. if bandwidth used > 70% of available network bandwidth, have found bottleneck.

a special network problem dns: can seen process stuck 5-10 seconds no reason, otherwise runs fine. use tcpdump -s1000 -n port 53 , see if questions being answered quickly. on machines involved in running job.

to shared lock harder. first have find suspect processes , have strace these.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -