Help - Search - Members - Calendar
Full Version: Load on P4 2.8 1GB of ram
The Planet Forums > Operating Systems > Red Hat Linux
jonMEGA
Hello. I took advantage of the zero setup and upgrade my server to a P4 2.8 with 1 GB of ram. Once again I'm having a load issue. I have TurckMM installed and apache with keepalive turned off.

Here is top:

CODE
12:35:41  up  2:44,  1 user,  load average: 119.89, 133.85, 138.43

389 processes: 285 sleeping, 103 running, 0 zombie, 1 stopped

CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle

          total   90.8%    0.0%    7.9%   0.1%     1.0%    0.0%    0.0%

          cpu00   90.2%    0.0%    7.9%   0.0%     1.7%    0.0%    0.0%

          cpu01   91.3%    0.0%    7.9%   0.3%     0.3%    0.0%    0.0%

Mem:  1028020k av,  936404k used,   91616k free,       0k shrd,   22844k buff

                   712172k actv,   80912k in_d,   11504k in_c

Swap: 2040212k av,  173988k used, 1866224k free                  215420k cached



 PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

10793 nobody    17   0 14792  13M  5108 R    18.7  1.3   0:14   0 httpd

10744 nobody    17   0  9840 9276  4716 R    11.6  0.9   0:05   1 httpd

10623 nobody    17   0 10388 9844  5276 R    10.7  0.9   0:19   1 httpd

10881 nobody    16   0  9612 9048  4604 R     8.8  0.8   0:01   1 httpd

10582 nobody    16   0 10820  10M  5572 S     5.2  0.9   0:30   1 httpd

10958 nobody    15   0  9356 8788  4392 S     4.6  0.8   0:01   0 httpd

10833 nobody    17   0 10004 9444  4752 S     3.0  0.9   0:17   0 httpd

10421 nobody    16   0 10128 9572  5024 R     2.7  0.9   0:34   1 httpd

10863 nobody    17   0  9792 9228  4808 R     2.6  0.8   0:12   0 httpd

10882 nobody    15   0 10364 9812  5380 S     1.8  0.9   0:17   1 httpd

11039 nobody    16   0  8308 7740  4276 S     1.4  0.7   0:00   1 httpd

11041 nobody    15   0  7932 7364  4300 S     1.4  0.7   0:00   0 httpd

11043 nobody    19   0  9172 8604  4184 R     1.2  0.8   0:00   1 httpd

10475 nobody    19   0 13672  12M  4844 R     0.9  1.2   0:43   0 httpd

10565 nobody    19   0 16488  15M  5208 R     0.9  1.5   0:40   1 httpd

10735 nobody    19   0 13680  12M  4852 R     0.9  1.2   0:21   1 httpd

10810 nobody    19   0 13748  12M  4916 R     0.9  1.2   0:27   1 httpd

10251 nobody    16   0 11296  10M  6108 S     0.8  1.0   0:27   0 httpd

10736 nobody    16   0  9960 9392  4976 S     0.8  0.9   0:22   1 httpd

10947 nobody    16   0  8208 7640  4000 S     0.7  0.7   0:00   0 httpd

10571 nobody    16   0 10712 9.9M  5584 S     0.6  0.9   0:19   0 httpd

10713 root      15   0  1464 1436   900 R     0.6  0.1   0:00   0 top

10743 nobody    15   0 10064 9500  4936 S     0.6  0.9   0:22   0 httpd

6282 mysql     16   0 19948 7428  1324 S     0.5  0.7   0:00   1 mysqld

10726 nobody    16   0  9832 9272  4744 S     0.5  0.9   0:22   1 httpd

10811 nobody    19   0 10168 9628  5080 R     0.5  0.9   0:10   1 httpd

10893 nobody    16   0  9776 9212  4656 R     0.5  0.8   0:23   0 httpd

11044 nobody    16   0  8208 7640  3996 S     0.5  0.7   0:00   1 httpd

10528 nobody    15   0 10904  10M  5912 S     0.4  1.0   0:27   1 httpd


Can I tweak the setting anymore to make the server run better ?
Matt Brown
what do the settings

minspareservers

and

maxspareservers

look like ?
jonMEGA
QUOTE (Matt Brown)
what do the settings

minspareservers

and

maxspareservers

look like ?


minspareservers 5

maxspareservers 10

startservers 5

maxclients 180

max requestsperchild 500

keepalivetimeout 15

MaxKeepAliveRequests 100

KeepAlive Off

timeout 300
Doodle
Hi jonMEGA

That's a seriously stressed box you have. I'm guessing that it's hosting the domain in your profile, Accoring to uptime.netcraft.com you appaear to have a cPanel box with mod_gzip enabled.

mod_gzip is a CPU killer in very busy boxes and totally useless in most cases. Disabling it should help in reducing CPU usage and the number of running processes.

IMHO it's not a good idea setting KeepAlive to Off. If there are more clients than Apache can handle they get queued in a backlog waiting for free child servers. With KeepAlive Off Apache needs to open a new child for every request, so each time a request is processed that user goes to the back of the queue.

Disable mod_gzip, restart Apache and run top for a few minutes and see if the load, CPU usage and runniing processes decrease.

Then use the following settings for Apache and monitor again with top for around 15 minutes and post the results.

Timeout 120
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 10
StartServers 20
MinSpareServers 10
MaxSpareServers 20
MaxClients 150
MaxRequestsPerChild 50

If the load has reduced to low single figures you can start increasing MaxClients in increments of 10 each time.

Then start reducing KeepAliveTimeout by 1 second at a time down to 5. Anything below 5 is not a good idea and could be much worse than using KeepAlive Off

Generally I find that KeepAliveTimeout between 5 and 6 works best for static sites with lots of images and between 8 and 10 for forums, dynamic content, lots of SSI, etc.

If the load and CPU is still in double figures mysql will also need some fine tuning.
jonMEGA
here is top after turning of mod_gzip

CODE
11:59:37  up  1:07,  1 user,  load average: 28.73, 22.25, 21.74

182 processes: 157 sleeping, 24 running, 0 zombie, 1 stopped

CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle

          total   89.8%    0.0%    8.5%   0.1%     1.3%    0.0%    0.0%

          cpu00   91.4%    0.0%    5.5%   0.1%     2.7%    0.0%    0.0%

          cpu01   88.2%    0.0%   11.5%   0.1%     0.0%    0.0%    0.0%

Mem:  1028020k av,  938280k used,   89740k free,       0k shrd,   20132k buff

                   764504k actv,   61848k in_d,   11056k in_c

Swap: 2040212k av,  113944k used, 1926268k free                  498492k cached



 PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

31028 nobody    17   0 10964  10M  5660 R     7.3  1.0   0:07   0 httpd

31027 nobody    16   0 11460  11M  6180 R     5.4  1.1   0:08   1 httpd

30819 nobody    16   0 10392  10M  5356 R     5.3  1.0   0:00   0 httpd

30794 nobody    16   0 11948  11M  6856 R     5.2  1.1   0:07   0 httpd

30832 nobody    15   0 11680  11M  6408 S     5.0  1.1   0:06   0 httpd

30886 nobody    16   0 11744  11M  6484 R     4.7  1.1   0:07   0 httpd

30828 nobody    16   0 11312  11M  6356 R     4.5  1.1   0:09   1 httpd

30775 nobody    15   0 11272  11M  6308 S     3.7  1.0   0:10   1 httpd

30814 nobody    16   0 11928  11M  6616 R     3.1  1.1   0:08   1 httpd

30774 nobody    16   0 10836  10M  5924 S     3.0  1.0   0:08   0 httpd

30839 nobody    16   0 11432  11M  6468 R     2.6  1.1   0:09   1 httpd

30792 nobody    16   0 10644  10M  5628 R     2.5  1.0   0:05   1 httpd

30823 nobody    15   0 11548  11M  6604 S     2.5  1.1   0:08   0 httpd

30777 nobody    16   0 10944  10M  5920 S     2.3  1.0   0:04   1 httpd

30789 nobody    16   0 11268  11M  6220 S     2.3  1.0   0:02   1 httpd

30795 nobody    16   0 11344  11M  6308 S     2.3  1.1   0:07   0 httpd

30808 nobody    15   0 10860  10M  5612 S     2.2  1.0   0:12   0 httpd

30836 nobody    15   0 11244  10M  5984 S     2.2  1.0   0:09   0 httpd

30772 nobody    17   0 12260  11M  6128 R     2.0  1.1   0:08   1 httpd

30807 nobody    16   0 11804  11M  6496 R     1.8  1.1   0:04   1 httpd

31024 nobody    15   0 11456  11M  6152 S     1.8  1.1   0:03   0 httpd

31074 nobody    16   0 10476  10M  5384 R     1.8  1.0   0:04   0 httpd

30809 nobody    16   0 11668  11M  6376 R     1.7  1.1   0:09   0 httpd

31047 nobody    15   0 10668  10M  5648 S     1.7  1.0   0:01   0 httpd

30829 nobody    15   0 11268  11M  6248 S     1.4  1.0   0:05   0 httpd

31038 nobody    17   0 10312  10M  5388 R     1.4  1.0   0:02   0 httpd

30790 nobody    16   0 12084  11M  6448 R     1.3  1.1   0:06   0 httpd

30827 nobody    16   0 11868  11M  6076 R     1.3  1.1   0:08   0 httpd

30793 nobody    16   0 11640  11M  6612 R     1.2  1.1   0:09   1 httpd

30822 nobody    16   0 10136 9.9M  5120 S     1.2  0.9   0:02   0 httpd

30841 nobody    15   0 10504  10M  5484 S     0.9  1.0   0:12   0 httpd

30770 nobody    15   0 11252  10M  5936 S     0.7  1.0   0:04   0 httpd

30816 nobody    15   0 10976  10M  5956 S     0.7  1.0   0:10   1 httpd

31043 nobody    15   0 11216  10M  6176 S     0.7  1.0   0:04   1 httpd

30802 nobody    16   0 12964  12M  5744 R     0.6  1.2   0:10   0 httpd

30884 nobody    15   0 14052  13M  6832 S     0.6  1.3   0:11   1 httpd

30780 nobody    15   0 10108 9.9M  5092 S     0.5  0.9   0:00   1 httpd

30811 nobody    15   0 11356  11M  6432 S     0.5  1.1   0:14   1 httpd

31073 nobody    15   0 10976  10M  5916 S     0.3  1.0   0:02   1 httpd

2587 mysql     15   0 15316 4460  1264 S     0.2  0.4   0:00   1 mysqld

30771 nobody    16   0 11308  11M  6400 R     0.2  1.0   0:08   0 httpd

30820 nobody    15   0 10512  10M  5608 S     0.2  1.0   0:11   0 httpd

31069 root      15   0  1388 1388   904 R     0.2  0.1   0:00   1 top

30765 nobody    15   0 11392  11M  6484 S     0.1  1.1   0:04   0 httpd

30779 nobody    15   0 11076  10M  6036 S     0.1  1.0   0:07   1 httpd

30781 nobody    16   0 10980  10M  5956 R     0.1  1.0   0:08   1 httpd
djc
mod_gzip doesn't make that big a difference in load, especially on a P4.

Do you have hostnamelookups turned on in your httpd.conf file? What kind of traffic is apache getting? Also, have you tried running without the PHP accelerator?

Dan
http://f2o.org/

QUOTE (jonMEGA)
here is top after turning of mod_gzip

CODE
11:59:37  up  1:07,  1 user,  load average: 28.73, 22.25, 21.74

182 processes: 157 sleeping, 24 running, 0 zombie, 1 stopped

CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle

          total   89.8%    0.0%    8.5%   0.1%     1.3%    0.0%    0.0%

          cpu00   91.4%    0.0%    5.5%   0.1%     2.7%    0.0%    0.0%

          cpu01   88.2%    0.0%   11.5%   0.1%     0.0%    0.0%    0.0%
jonMEGA
hostnamelookups is turned off
jonMEGA
here is top once again after som more tweaking:

CODE
16:49:42  up  5:57,  1 user,  load average: 60.69, 51.25, 32.20

255 processes: 228 sleeping, 26 running, 0 zombie, 1 stopped

CPU states:  cpu    user    nice  system    irq  softirq  iowait    idle

          total   91.6%    0.0%    7.2%   0.3%     0.7%    0.0%    0.0%

          cpu00   90.4%    0.0%    7.7%   0.3%     1.3%    0.0%    0.0%

          cpu01   92.7%    0.0%    6.8%   0.2%     0.0%    0.0%    0.0%

Mem:  1028020k av,  951964k used,   76056k free,       0k shrd,   27056k buff

                   720960k actv,   92040k in_d,   14500k in_c

Swap: 2040212k av,  214292k used, 1825920k free                  259320k cached



 PID USER     PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME CPU COMMAND

9538 nobody    19   0 14716  13M  5260 R    14.5  1.3   0:19   0 httpd

9350 nobody    15   0 10196 9532  5276 S    10.7  0.9   0:16   0 httpd

9549 nobody    15   0  9736 9092  4780 S     5.4  0.8   0:17   0 httpd

9630 nobody    16   0 10144 9500  5296 S     5.3  0.9   0:20   1 httpd

9527 nobody    16   0 10708 9.8M  5540 S     3.6  0.9   0:13   0 httpd

9578 nobody    16   0  9908 9264  4700 S     2.9  0.9   0:24   1 httpd

9521 nobody    15   0  9832 9188  4712 S     2.6  0.8   0:20   1 httpd

9352 nobody    15   0  9636 8984  4716 S     2.5  0.8   0:16   0 httpd

9358 nobody    15   0 10432 9808  5228 S     2.5  0.9   0:14   0 httpd

9678 nobody    19   0 14184  13M  4752 R     2.5  1.3   0:09   1 httpd

9536 nobody    16   0 10700 9.8M  5552 S     2.4  0.9   0:08   1 httpd

9340 nobody    15   0 10520 9888  5312 S     2.2  0.9   0:26   0 httpd

9681 nobody    16   0 10004 9396  5128 S     2.2  0.9   0:03   0 httpd


Timeout 120
KeepAlive On
MaxKeepAliveRequests 50
KeepAliveTimeout 10
StartServers 20
MinSpareServers 10
MaxSpareServers 20
MaxClients 140
MaxRequestsPerChild 50
Guspaz
I flat out reccomend AGAINST turning off mod_gzip.

mod_gzip results in a very small increase in CPU load, but an enormous reduction in bandwidth usage. Bandwidth is more valuable than CPU power.

You're running a PHP-Nuke site, which is MySQL heavy. Try tweaking MySQL a bit on the box, give it some more memory.

Also, try disabling mmcache. It hasn't been updated in ages and may be causing problems with the new version of PHP you're running.
jonMEGA
QUOTE (Guspaz)
I flat out reccomend AGAINST turning off mod_gzip.

mod_gzip results in a very small increase in CPU load, but an enormous reduction in bandwidth usage. Bandwidth is more valuable than CPU power.

You're running a PHP-Nuke site, which is MySQL heavy. Try tweaking MySQL a bit on the box, give it some more memory.

Also, try disabling mmcache. It hasn't been updated in ages and may be causing problems with the new version of PHP you're running.


What mysql tweaks should I try.

Thanks for all the help so far everyone !!!
alex042
Have you had this load issue for a while? Did it start at any particular time? If it was a sudden surge, maybe it's a particular site causing the problem. There are a lot of other areas that could be tweak other than just those you've mentioned, but if it's a particular site, it would be easier to find that and resolve it.

Btw, before I leased my own server, my previous host was running at 100+ load for several days or weeks on and off and eventually, the hard drive went out and we lost everything (since he didn't have a backup) and had to reupload and rebuild. So, although a server can run at that load, it may take its toll if it can't be resolved fairly soon.
jonMEGA
QUOTE (alex042)
Have you had this load issue for a while? Did it start at any particular time? If it was a sudden surge, maybe it's a particular site causing the problem. There are a lot of other areas that could be tweak other than just those you've mentioned, but if it's a particular site, it would be easier to find that and resolve it.  

Btw, before I leased my own server, my previous host was running at 100+ load for several days or weeks on and off and eventually, the hard drive went out and we lost everything (since he didn't have a backup) and had to reupload and rebuild. So, although a server can run at that load, it may take its toll if it can't be resolved fairly soon.


No the past two weeks I more than doubled the traffic to my site.

BTW two days ago I ordered another server to replace this one. I got the Super Xeon.

I'm playing around with the settings and it seems that I'm having the same issues even with the new server. icon_confused.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.