Link to home
Start Free TrialLog in
Avatar of Jekyll_phd
Jekyll_phd

asked on

Monitoring PHP executed as CLI on Ubuntu

I'm executing a php script as CLI, depending on the resources on the server it creates additional instances of itself to leverage as much of the CPU as possible.

The problem: I did a stress test and at first it worked phenomenally, but then ground down to a snail's pace. When I run "top" at the command line I have an abnormally large percentage of my cpu designated to (50-90% usually) %w (iowait) and almost all the rest is taken up by the idle process, which would make me assume that I have processing power to spare, but my MySQL queries are taking 300x longer then their benchmarks to execute, and it takes me what seems to be ages to even login to the server via ssh... so I know something is wrong.

My question is the following: How can I verify from the command line if, and how many instances are running (without looking at the MySQL database it's updating)? I'm pretty sure if I know how to do that, I can figure out what's going on... but if anyone has any other suggestions, I'll be glad to entertain those as well.
SOLUTION
Avatar of TobiasHolm
TobiasHolm
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jekyll_phd
Jekyll_phd

ASKER

Thanks to both of you,

@Tobias- cacti looks pretty cool, and it'll definitely serve me well in the future.

for anyone else stumbling upon this thread, these two links proved to be useful in my install
http://www.ubuntugeek.com/install-and-configure-cacti-monitoring-tool-in-ubuntu-9-10-karmic-server.html
http://forums.cacti.net/about36427.html&highlight=ereg_replace++depreciated

@torimar- yes I really am that dumb. I was completely unaware of the ps command.

I'm splitting the points because Tobias's solution will help me avoid these jams in the future, but torimar's was immediately useful.