It is currently Tue Feb 07, 2012 8:49 am

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: server restarted, now multiple apache processes running
PostPosted: Thu Sep 08, 2005 5:52 pm 
Offline

Joined: Thu Sep 08, 2005 5:15 pm
Posts: 2
Our server was restarted a few weeks ago. Since then, we have noticed that there are multiple apache processes running and our mysql cpu usage jumps from 9% to 78% to 90% at times. Our website has also slowed down significantly.

We are running apache & mysql, on a freebsd environment.

Can anyone help us figure out why new apache processes are being created and how it can be fixed?

We appreciate any help you can give us. Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 6:07 pm 
Offline

Joined: Sun May 02, 2004 11:34 pm
Posts: 6498
Location: toronto, canada
The mysql jumps are likely due to either
a. load on the system (ie large number of concurrent users); or
b. poorly formed queries; or
c: badly indexed tables (where the index is not being used)

Solutions for mysql:
a. maybe time to move to separate machines (or replication where inserts got to one machine and select queries are read from the slave machine) to spread the load out...don't have enough info about site/environment to be able to guide more
b. revisit and tune the queries. table order in joins makes a big difference in how mysql uses the memory
c. check your indeces and apply indeces on table to match the where clauses in the sql statements
d. upgrade mysql to 4.1 to take advantage of newer features like subqueries

Apache:
Can't really help you here except to say that you should probably kill the rogue processes. Check the log files to track what is happening and for any potential problems.

_________________
Lostboy

Cat, the other other white meat

Please read Posting Etiquette before posting

You can always try Google


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 6:53 pm 
Offline

Joined: Tue Aug 30, 2005 8:42 pm
Posts: 44
Re Apache:

How many apache processes are running, and what version of apache are you running? If you are running apache 1.x, then apache is supposed to have multiple processes running. It is how apache manages to serve multiple clients at the same time.

If you are running apache 2, you are given a choice as to how apache handles multiple clients. One of these is through a pre-fork MPM, which basicly mirrors the apache 1.3 behavour.

Multiple processes from apache aren't something I would worry about.

90% CPU usage from MySQL however is. Unfortunately I have no words of advice for this, other than to keep a log of when CPU usage is high, and to compare it with the MySQL logs.

Failing that(and the steps outlined by lostboy) you may need to redesign your website backend, to include a db caching system.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 7:09 pm 
Offline

Joined: Thu Sep 08, 2005 5:15 pm
Posts: 2
Thank you both very much. I will start focusing on the mysql queries and the db cache.

I appreciate your tips and fast reply!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron