I am running 5 instances of a PHP script using Supervisord. Running 5 processes is the optimal number to maximize the processing that my PHP script does. If I run more than 5 or less than 5, I get worse results.
I’m already profiling the PHP script itself with xdebug and webgrind.
I suspect that disk I/O is what’s preventing me from running more parallel processes as my CPU and Memory are not maxed out with 5 processes running. I have 4 virtual cores on an Amazon EC2 instance, and neither Mysqld nor Supervisord are using more than 50% CPU at any given time.
How does one profile disk I/O on a Linux Cent OS machine ( does this sound like the culprit )?
What other bottlenecks should I be looking for?
–SOLUTION–
I was unable to find any simple solutions that gave me very in depth information. I’m not exactly sure what I’m looking for though, so I apologize for this question and answer being vague.
I would look at
iostat -c -n 1while your script is running and see what is reported in the %util column on the far right. If your hunch is right, then the %util should be close to 100% while your processes are running.Does this script do any processing that fetches data over the network? That could also be a bottleneck.
Its hard to say more without knowing a little more about what the script does. What is each process doing? How did you determine that 5 is the optimal number of processes?