LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-13-2012, 05:01 AM   #1
Kuldeep1333
LQ Newbie
 
Registered: Mar 2012
Location: Noida
Posts: 28

Rep: Reputation: Disabled
Need help on Apache Performance


Hi,

there are 25 websites running on our server, Unluckily one site uses too much memory,
normally our server consume Approximate 15% memory but when i switch ON this site, memory uses jump to more then 80%
some time it hangs the server. i still can't find which process in this site actually taking such a huge memory usage.
How can i check which process consume huge amount of memory to resolve this issue ?
following are the some output that i capture from some commands,

outpput from capture command:
[root@L8 ~]# top

top - 01:25:27 up 6 days, 17:28, 2 users, load average: 2.15, 2.87, 2.89
Tasks: 266 total, 1 running, 260 sleeping, 0 stopped, 5 zombie
Cpu(s): 14.3%us, 42.0%sy, 0.0%ni, 42.2%id, 1.4%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 8173984k total, 6803796k used, 1370188k free, 19408k buffers
Swap: 2096472k total, 144k used, 2096328k free, 84456k cached

[root@L8 ~]# sar -r 1 15

03:43:31 AM kbmemfree kbmemused %memused kbbuffers kbcached kbswpfree kbswpused %swpused kbswpcad
03:43:32 AM 484996 7688988 94.07 34136 221336 2096328 144 0.01 24
03:43:33 AM 484096 7689888 94.08 34172 222180 2096328 144 0.01 24
03:43:34 AM 483264 7690720 94.09 34172 222972 2096328 144 0.01 24
03:43:35 AM 482424 7691560 94.10 34172 223632 2096328 144 0.01 24
03:43:36 AM 481644 7692340 94.11 34180 224428 2096328 144 0.01 24
03:43:37 AM 480744 7693240 94.12 34180 225528 2096328 144 0.01 24
03:43:38 AM 479904 7694080 94.13 34216 226324 2096328 144 0.01 24



following are the amount of processes and amount of threads defined in apache configuration

<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
ServerLimit 256
MaxClients 256
MaxRequestsPerChild 500
</IfModule>
<IfModule worker.c>
StartServers 2
MaxClients 12
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>


how can i resolve this issue ?

Last edited by Kuldeep1333; 04-13-2012 at 05:02 AM.
 
Old 04-13-2012, 05:34 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
What's different about this one website? Does it get considerably more traffic? Does it use PHP / MySQL resources? You may simply have a website that is too "big" for that server.
 
Old 04-13-2012, 05:39 AM   #3
Kuldeep1333
LQ Newbie
 
Registered: Mar 2012
Location: Noida
Posts: 28

Original Poster
Rep: Reputation: Disabled
yes it's a PHP website, also use mysql..... this website use approximate 5-6 GB bandwidth per day....
 
Old 04-13-2012, 06:59 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Well as you don't say what the specs are of your initial server I'm guessing that it's under-powered for that website.
 
Old 04-13-2012, 07:55 AM   #5
Kuldeep1333
LQ Newbie
 
Registered: Mar 2012
Location: Noida
Posts: 28

Original Poster
Rep: Reputation: Disabled
Red Hat Enterprise Linux Server release 5.6
Memory 8 GB, Swap 2 GB,
CPU Model name : CPU Intel(R) Xeon(R) CPU L5335 @ 2.00GHz
PHP 5.2.17,
Mysql Server version: 5.0.77 Source distribution
 
Old 04-13-2012, 08:04 AM   #6
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Ok, so it's a quad-core based on a 2007 processor, I was doing well over 60,000 page displays a day on something older.

Are the performance stats you gave with or without this site running?

The thing that looks odd is the 42.0%sy in your top output. Normally I'd expect a much lower value than 42%.
 
Old 04-15-2012, 08:58 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well the mem use is o, in as much as (in *nix) RAM is there to be used, otherwise its wasted money.
Note that its using almost no swap, so I don't think you've got a mem leak, just a large-ish site.
The 42% sys usage is interesting though.
Does this site do a lot of disk writing; what does top look like for the processes?
You can check what the DB is doing using 'show processlist' https://dev.mysql.com/doc/refman/5.1...ocesslist.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance tuning of apache malay_biswal Linux - Server 1 10-06-2011 07:35 PM
Apache performance testing kirukan Linux - Server 4 05-02-2009 06:56 AM
apache performance mahmoud Linux - Software 2 01-19-2009 05:34 PM
apache performance tuning sachin1361 Linux - Enterprise 1 03-05-2007 06:19 AM
Apache Performance Crashed_Again Linux - Software 7 12-18-2003 04:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration