PDA

View Full Version : This is my config and it's getting slow



edouard
04-05-2007, 06:47 AM
Hi,

I'm currently a little confused between my config and the server maintenance and outage.

Last night I met the following error:
[Thu Apr 5 00:01:18 2007] [notice] child pid 7844 exit signal Segmentation fault

thousands lines... till I get up and restart.
Since a while my websites are slower than before.
My websites are made in Php; here is the what ps -aux gives me right now:



2219 2351 0.0 0.0 2164 864 pts/0 S 02:55 0:00 /bin/sh /usr/loca
2219 2388 0.0 0.1 25644 4140 pts/0 SN 02:55 0:00 /usr/local/mysql/
2219 2390 0.0 0.1 25644 4140 pts/0 SN 02:55 0:00 /usr/local/mysql/
2219 2391 0.0 0.1 25644 4140 pts/0 SN 02:55 0:00 /usr/local/mysql/
2219 2417 0.0 0.2 63588 8728 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2422 0.0 0.3 64720 12060 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2423 0.0 0.3 64688 12676 ? S 02:55 0:01 /usr/sbin/httpd -
2219 2428 0.0 0.3 64660 12712 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2436 0.0 0.3 64680 11788 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2437 0.0 0.3 64624 11956 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2559 0.0 0.3 64644 13364 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2567 0.0 0.2 64604 11460 ? S 02:55 0:00 /usr/sbin/httpd -
2219 2751 0.0 0.3 64648 12208 ? S 02:56 0:00 /usr/sbin/httpd -
2219 3067 0.0 0.3 64668 11656 ? S 02:56 0:00 /usr/sbin/httpd -
2219 5133 0.0 0.3 64704 12044 ? S 03:00 0:00 /usr/sbin/httpd -
2219 5165 0.0 0.3 64668 13200 ? S 03:00 0:00 /usr/sbin/httpd -
2219 9217 0.0 0.2 64664 11488 ? S 03:05 0:00 /usr/sbin/httpd -
2219 9227 0.0 0.2 64644 10676 ? S 03:05 0:00 /usr/sbin/httpd -
2219 9247 0.0 0.3 64704 11920 ? S 03:05 0:00 /usr/sbin/httpd -
2219 9248 0.0 0.2 64604 11456 ? S 03:05 0:00 /usr/sbin/httpd -
2219 10023 0.0 0.3 64684 11964 ? S 03:06 0:00 /usr/sbin/httpd -
2219 10081 0.0 0.2 64608 11340 ? S 03:06 0:00 /usr/sbin/httpd -
2219 26248 0.0 0.2 64616 11096 ? S 05:35 0:00 /usr/sbin/httpd -
2219 26335 0.0 0.2 64584 11160 ? S 05:35 0:00 /usr/sbin/httpd -
2219 26338 0.0 0.2 64596 11160 ? S 05:35 0:00 /usr/sbin/httpd -
2219 6216 0.0 0.0 2264 1292 pts/2 S 05:57 0:00 -sh


and here s my httpd.conf config:

Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MinSpareServers 5
MaxSpareServers 20
StartServers 2
MaxClients 50


I only consume 10% of the whole bandwidth, I guess everything has to do with RAM, I am consuming too much RAM, is this normal? Do I need to upgrade or change few things?

Thanks in advance for your help.

wildjokerdesign
04-05-2007, 07:14 AM
How many other errors are showing up in the error log? Often Apache well shut down if you get to many errors but it is supposed to restart. The "Segmentation fault" is often sign of that although the error you posted looks a bit different. I would send a report into WH via their support ticket system on this. Your output from ps -aux does not look quite right to me.

I run php on most all my sites and I don't think that should be affecting things that much unless it is just really poorly written code. :) You can try installing eAccelerator via the Site Manager but in this case may not make that much difference. I have actually seen a slow down on one of my sites recently but I doubt that well change till it can be moved to the new WH 3.0 that well be coming out latter this year.

edouard
04-05-2007, 07:25 AM
thanks for your reply, I contacted the support service who told me to turn on the error report which I did but so far nothing appeared inside my logs.
I already installed the eAccelerator since it's available (actually since that time, I have problems ;))

what's not right about that ps -aux ... too many processes? How to fix this?

wildjokerdesign
04-05-2007, 07:46 AM
Seems to be alot of:

2219 2417 0.0 0.2 63588 8728 ? S 02:55 0:00 /usr/sbin/httpd -

I may be wrong about that since this is not my area. :) You can try uninstalling eAccelerator or even disabling it. What type of php are you running? I know that some scripts use eAccelerator but I think in that case it is "doing" double duty. I use SMF and they have the option to use it to cache things. The only thing is from what I can tell the install via Site Manager actually caches everything php and then it seems to me that SMF caches on top of that. I may be wrong about this but it seemed redundant to me so I ended up removing it. I just have not studied it enough to know.

corvus
04-06-2007, 11:27 AM
edouard

I'd agree with Shawn about the number of httpd processes. It seems like it's a bit high given the amount of cpu time that each process has taken.

Consider the cropped version of the ps -aux from my VPS. If you look at the time column, you can see that each process has a good amount of CPU time. The only exception is the parent process but that's expected.




USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
2194 10723 0.0 0.1 26652 5504 ? S Mar14 0:00 /usr/sbin/httpd -
2194 15789 0.0 0.5 39184 21884 ? S Mar14 13:28 /usr/sbin/httpd -
2194 3805 0.0 0.1 38080 7500 ? S Mar16 5:10 /usr/sbin/httpd -
2194 9489 0.0 0.5 40044 22076 ? S Mar26 8:16 /usr/sbin/httpd -


You've got ~20 processes that are not showing much CPU time at all. I'd guess that some of them are idling but can't be sure. You can reduce the number of processes that are idling by changing the settings to something like:




KeepAliveTimeout 5
MinSpareServers 5
MaxSpareServers 10
StartServers 5


This won't allow as many idle processes to just be sitting. You can also check http://yourdomain.com/server-status/ if you have that enabled. It will tell you how many of your processes are currently enabled. This would be a good place to start to make sure you don't need that many processes.

Check the CPU time after a bit to see if all the processes are getting used. If after a day or so, there are still processes that haven't used any CPU time, then those are really excessive.