Solved

Monitoring PHP executed as CLI on Ubuntu

Posted on 2010-08-17
3
416 Views
Last Modified: 2013-12-06
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.
0
Comment
Question by:Jekyll_phd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Assisted Solution

by:TobiasHolm
TobiasHolm earned 250 total points
ID: 33461305
Hi!

You can try 'Cacti' to monitor your performance. It is in apt, so it is easy to install and also easy to config.

Ref: http://cacti.net/

Regards, Tobias
0
 
LVL 35

Accepted Solution

by:
torimar earned 250 total points
ID: 33463225
>> "How can I verify from the command line if, and how many instances are running"

How many instances of what? Your script? Use:

ps -ef | grep scriptname

You may, of course, also use that with 'grep mysql' or 'grep http'.

Hope I didn't misunderstand you.
0
 
LVL 2

Author Comment

by:Jekyll_phd
ID: 33464955
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.
0

Featured Post

Myth Busting: MongoDB Scalability (it scales!)

I was talking with one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. He mentioned to me that several customers have been telling him that “MongoDB doesn’t scale!” MongoDB’s scalability was in question?

My response was, “Is that a joke?"

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question