High server load with upgrade to APACHE 2.2.8

Support for webhosts that use CentOS
Post Reply
ZenonK
Posts: 10
Joined: 2008/04/24 19:59:16
Contact:

High server load with upgrade to APACHE 2.2.8

Post by ZenonK » 2008/04/25 02:55:09

Hey all,

I have a server with dual Xenon 3.0 processors and 4 Gigs of ram. Until recently we were using Apache 1.6 and our server load was usually between 3 and 6. Since we updated to 2.2.8 our server loads have skyrocketed to 10-20, and although server response in somewhat slower, it is not nearly as slow as would expect it to be. We also had severe php issues associated to the update. We are running PHP4 as DSO and PHP5 as fcgi. All sites that had php5 code no longer functioned since they started to be parsed with php4, and we had to add an additional handle to the htaccess to force php5 parsing. But anyway although I would like an answer to why that started happening for my own peace of mind, it works and thats all I care about. I am more interested in the lowering the CPU back to a reasonable value. I don't know what information I can include to assist with the diagnosis so I'll gove some basic server information to start. And post back whatever you figure might help with the solution.

Thanks in advance,
Zenon

Server Information:
Processor Information

Processor #1 Vendor: GenuineIntel
Processor #1 Name: Intel(R) Xeon(TM) CPU 3.00GHz
Processor #1 speed: 3000.323 MHz
Processor #1 cache size: 2048 KB

Processor #2 Vendor: GenuineIntel
Processor #2 Name: Intel(R) Xeon(TM) CPU 3.00GHz
Processor #2 speed: 3000.323 MHz
Processor #2 cache size: 2048 KB

Processor #3 Vendor: GenuineIntel
Processor #3 Name: Intel(R) Xeon(TM) CPU 3.00GHz
Processor #3 speed: 3000.323 MHz
Processor #3 cache size: 2048 KB

Processor #4 Vendor: GenuineIntel
Processor #4 Name: Intel(R) Xeon(TM) CPU 3.00GHz
Processor #4 speed: 3000.323 MHz
Processor #4 cache size: 2048 KB


Memory Information
Memory: 4134448k/4718592k available (4478k kernel code, 57152k reserved, 656k data, 288k init, 3274496k highmem)

System Information
Linux venus.bhservers.com 2.6.20.4-ts.grh.mh.i386 #1 SMP Fri Mar 30 09:26:20 EDT 2007 i686 i686 i386 GNU/Linux

Physical Disks
hdb: Slimtype COMBO SOLC-2481K, ATAPI CD/DVD-ROM drive
hdb: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
sda: Write Protect is off
sda: Mode Sense: 00 3a 00 00
SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 1:0:0:0: Attached scsi disk sda
SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 3a 00 00
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
SCSI device sdb: 488397168 512-byte hdwr sectors (250059 MB)
sdb: Write Protect is off
sdb: Mode Sense: 00 3a 00 00
SCSI device sdb: write cache: enabled, read cache: enabled, doesn't support DPO or FUA
sd 1:0:1:0: Attached scsi disk sdb

Current Memory Usage
total used free shared buffers cached
Mem: 4135132 3910908 224224 0 279132 2428236
-/+ buffers/cache: 1203540 2931592
Swap: 2096440 43436 2053004
Total: 6231572 3954344 2277228

Current Disk Usage
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 1.5G 653M 748M 47% /
/dev/sdb1 230G 114G 104G 53% /backup
/dev/sda7 201G 116G 75G 61% /home
/dev/sda3 9.7G 5.7G 3.5G 62% /usr
/dev/sda2 16G 11G 3.7G 76% /var
none 2.0G 0 2.0G 0% /dev/shm
/usr/tmpDSK 485M 17M 443M 4% /tmp
/tmp 485M 17M 443M 4% /tmp

MajorNewbie
Posts: 127
Joined: 2008/04/17 00:04:43

Re: High server load with upgrade to APACHE 2.2.8

Post by MajorNewbie » 2008/04/25 15:09:59

Yes I have been doing some research into that likewise, apparently Apache from version 2 onwards is multi-threaded rather than forking child-processes.

I was thinking that a forked process is in its own sandbox and though it swallows up a lot of resource upfront it won't hit the CPU so hard trying to manage the additional tasks of resource allocation between threads.

Here's hoping some experienced gurus would comment on issue of memory leaks.

Could it be the management of the resources in a multi-threaded environment that is soaking up CPU cycles?

User avatar
toracat
Forum Moderator
Posts: 7427
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: High server load with upgrade to APACHE 2.2.8

Post by toracat » 2008/04/25 15:53:10

[quote]
MajorNewbie wrote:
Yes I have been doing some research into that likewise, apparently Apache from version 2 onwards is multi-threaded rather than forking child-processes.
[/quote]
I'm not a guru, so this is just a comment rather than help. If I'm not mistaken, httpd shipped by CentOS-5 (httpd-2.2.3) runs in multi-process mode by default, not multi-threaded. The original poster apparently installed apache from somewhere else, so it is hard to judge.

ZenonK
Posts: 10
Joined: 2008/04/24 19:59:16
Contact:

Re: High server load with upgrade to APACHE 2.2.8

Post by ZenonK » 2008/04/25 20:46:51

I just realized one error I made is that I posted this in the Centos 5 forum because I have another post going in another category and I forgot to change to Centos 4 forum before posting this topic so my apologies. My build was with the easy APACHE tool that comes in CENTOS 4.6

However I have herd of that CENTOS 5 was having the same additional load issues with the new v2.2 of APACHE.

Can someone explain to me exactly what all the followign data means:
Current Memory Usage
................. total............. used ........ free ....... shared ... buffers ..... cached
Mem:...... 4135132 ... 3910908 ... 224224 ........ 0 ....... 279132 ... 2428236
-/+ buffers/cache: .... 1203540 ... 2931592
Swap:.... 2096440 ... 43436 ....... 2053004
Total:..... 6231572 ... 3954344 ... 2277228

I interpret the total used and free memory, as well as what the swap is all about, but I don;t know what the shared, buffers, chached are representing or wha the line "-/+ buffers/cache:" is telling me. My asumption is that the server seems to be running pretty well max on the RAM, and an upgrade int hat area is probably necessary for this machine.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: High server load with upgrade to APACHE 2.2.8

Post by gerald_clark » 2008/04/25 20:53:18

Wow!
You have almost 4G of swap in use.
Did you over-tune mysql?

movieman
Posts: 180
Joined: 2008/03/20 05:19:16
Location: Canada

Re: High server load with upgrade to APACHE 2.2.8

Post by movieman » 2008/04/25 20:55:43

Linux will cache disk files in RAM, so it's not uncommon to see the RAM being full even though the programs that are running aren't using much of it; the rest are files that have been read from disk (or written to it) at some point. However, the server may run faster with more RAM to cache more files.

Edit: P.S. Isn't that 40MB of swap in use, not 4GB?

ZenonK
Posts: 10
Joined: 2008/04/24 19:59:16
Contact:

Re: High server load with upgrade to APACHE 2.2.8

Post by ZenonK » 2008/04/26 06:05:59

[quote]
Wow!
You have almost 4G of swap in use.
Did you over-tune mysql?
[/quote]

Yes its 40MB int this case LOL but don't laugh, I did have a another server with a 4 Gig swap file is use... I ended up rebooting it and all was well now it sustains about 400-500 swap in use.

[quote]
movieman wrote:
Linux will cache disk files in RAM, so it's not uncommon to see the RAM being full even though the programs that are running aren't using much of it; the rest are files that have been read from disk (or written to it) at some point. However, the server may run faster with more RAM to cache more files.

Edit: P.S. Isn't that 40MB of swap in use, not 4GB?[/quote]

So that explains why my other server with only 2Gigs of ram still has the RAM full but isn't running a huge swap file; its the chacheing of recent files. Can I infer from those stats that the system has about 2-3 gigs of the RAM used for file cacheing? If so what number is the actual cached value, 2.4GB or 2.9GB?

Is there a point with CENTOS5 on a web hosting server where the addition of RAM is either useless or even worse a detriment to performance? I know it is limited to 16GB but I am considering either putting in 8 or 12GB of ram into a new dual quad core server.

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: High server load with upgrade to APACHE 2.2.8

Post by gerald_clark » 2008/04/28 14:47:48

I see, you user free -t.
I misread your total line as swap.

Post Reply

Return to “CentOS 5 - Webhosting Support”