Jump to content
Sign in to follow this  
faifas

Load average is going wild

Recommended Posts

Hello fellows,

 

I'm having a weird issue and wanted to find out if any of you know how to deal with it.

I've got myself Ubuntu box and online RPG game hosted on it.

The problem is that apache and mysqld is going wild (I mean it).

 

load average: 1.22, 1.20, 1.07

 

That's an usual load when I only have 40 players online.

Tried stopping apache, server load went to 0.02 (ircd was using it)

 

Server speed: 2.0Ghz

RAM: 500mb

apache conf:

timeout 5

 

Keepalive On

keep alive timeout 15

 

My server is good enough for such project and I can bet that I have a bug somewhere in my PHP code, that causes a never ending loop and apache with mysqld are going wild.

 

Mysql is using ~20% of CPU and few apache childs are using ~11% each, so that's really not normal.

 

What do I want you to help me with is a tool for showing php files CPU usage or something similar, so that I could find out which of my files are causing that server load.

 

Thanks in advance,

Faifas

Share this post


Link to post
Share on other sites

hi, interesting problem as i've seen it myself on this server when it got on the front page of Digg.com

 

however, at the time i didn't bother to read my http.conf better, if i had I probably would have noticed this

 

# for digg do MinSpareServers 15
MinSpareServers 5
# digg > MaxSpareServers 65
MaxSpareServers 10
#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 15

#

 

i've now changed it to this and restarted apache

 

# for digg do MinSpareServers 15
MinSpareServers 15
# digg > MaxSpareServers 65
MaxSpareServers 65
#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 15

#

 

i wonder could this also help you ? also, my keep alive is set to Off

 

why have you set yours to on ?

 

cheers

anyweb

Share this post


Link to post
Share on other sites

keepalive is generally not a good option to have on unless you run like a image hosting service where you want to show a lot of pictures at once to a client

Share this post


Link to post
Share on other sites

Thank you both for your answers,

 

while I was waiting for them I've realized that I had to do something on my own, so first thing I did was lowered memory setting in php.ini

That really helped a little and now I am going to try out your tips.

 

I never really understood what is keepalive and should I turn it on or off, now I realize that I had to turn it off.

 

Thank you!

Faifas

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...