You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by kulbir Saini <ku...@gmail.com> on 2009/03/12 17:05:10 UTC
[users@httpd] Apache Tunning
Issue- We have web server with two instances of apache running. Its with
Worker MPM. Traffic is around 4200 hits/min on the server(both instances).
We see server getting into high load raises above 5-6 and most of the CPU
used is in "user space" by httpd process. Its a 2Dual core CPU box. when
load reaches around 5, i checked vmstat and it gives process in cpu run
queue above 4 or 5. Since its a prod box we get alert and need to bounce.
The server environment is-
Environment - 2 apache instances with corresponding tomcat instances.
Applciation - Used to server a simple .pac file.
Scenario -
OS - RHEL2AS ( 2.4.9-e.40enterprise #1 SMP)
apache- Apache/2.0.48
arch - 32bit
memory - 4GM + 1GB swap
httpd.conf (worker setting original)
<IfModule worker.c>
#ServerLimit 25
StartServers 2
MaxClients 300
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestsPerChild 20000
</IfModule>
KeepAlive is ON. KeaapAliveTime is default(15)
the httpd "RSS" value is appx 4.2MB
Need help in tunning apache so that best use of Hardware resources can be
made.
Thanks
Kulbir
Re: [users@httpd] Apache Tunning
Posted by Tadeu Alves <ta...@gmail.com>.
Man i was looking for the right calculation about this question will help me
very much because we're have this problem an is a pain in the *** well ill
post below our server configuration, for now is very stable but consumes too
much memory (mysql=php+apache) for moodle so here it i want about 800
simultaneous users connected if i'm right will be serverlimit 20 startserver
10 threadsperchild 40
i'll put it to test
the server configuration is a dell poweredge 1950 with raid 1 sas 73gb 8gb
memory dual xeon 5430 on a Red Hat Enterprise Linux x64 Mysql 5.0.45, php
5.1.6 and Apache 2.2.3
thanks for the heads up and i'll put about MaxRequestPerChild 10000 and see
the server working this weekend if it doesn't make any crashes then i'll
stay with this variable then i'll change the other variables and see it too.
On Fri, Mar 13, 2009 at 2:45 PM, Anthony J. Biacco <
abiacco@formatdynamics.com> wrote:
> 1. I have to rail totally against this. The more you lower
> MaxRequestsPerChild, the more often apache is killing and recreating a child
> process. At numbers as low as 2000 or lower, you’re starting to defeat the
> whole purpose of using the worker mpm.
>
> >=50% of apache’s time is going to be spent managing child processes on a
> high traffic site. MaxRequestsPerChild should either be 0 or something very
> high. IF your process memory usage gets higher and higher, then you have a
> memory leak somewhere.
>
> 2. Don’t use ThreadLimit, stick with ThreadsPerChild
>
> 3. You MaxClients doesn’t sync up to your other numbers. MaxClients is
> going to be ServerLimit x ThreadsPerChild. So for you, 1500. If you want to
> serve 1500 concurrent reqs, then set MaxClients to match this at 1500. If
> you want 500, then change ServerLimit,StartServers and ThreadsPerChild so
> the math is right. For instance, ServerLimit 10, StartServers 5,
> ThreadsPerChild 50 will be you a MaxClients of 500.
>
> If you give us your server parameters (cpu, memory, modules loaded, apache
> rss usage, types of files served), we’d be able to better recommend numbers
> for what your server can support.
>
>
>
> -Tony
>
> ---------------------------
>
> Manager, IT Operations
>
> Format Dynamics, Inc.
>
> 303-573-1800x27
>
> abiacco@formatdynamics.com
>
> http://www.formatdynamics.com
>
>
>
> *From:* Tadeu Alves [mailto:tadeudca@gmail.com]
> *Sent:* Friday, March 13, 2009 8:45 AM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] Apache Tunning
>
>
>
> nice one. Getting on this hook, in my server we run moodle i dunno if you
> guys know about it and a very high hits/second i wan't to know if going down
> about MaxRequestsPerChild 500 will be good to performance and any idea about
> changing my server variables to make it support more concurrent connections
>
>
>
> ########################################
>
> <IfModule worker.c>
> ServerLimit 30
> ThreadLimit 70
> StartServers 20
> MaxClients 500
> MinSpareThreads 10
> MaxSpareThreads 15
> ThreadsPerChild 50
> MaxRequestsPerChild 2000
> MaxMemFree 5000
> #ReceiveBufferSize 714400 (not using anymore)
>
>
>
> #################################
>
>
>
>
>
> On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala <ga...@deeproot.co.in>
> wrote:
>
> Hi Kulbir,
>
>
>
> Gaurav wrote:
>
> Tadeu Alves wrote:
>
> i thibk that you can down the variable
> MaxRequestsPerChild 20000 to 2000 it's too much and if the child process
> keeps the request well i't grows bigger and bigger in memory
>
>
> Even 2000 is too much. Various high load,high traffic servers also don't
> have this much high value.
>
>
>
> Found this: http://rimuhosting.com/howto/memory.jsp may be useful to you.
>
>
>
>
> --
> Cheers,
>
>
> Gaurav Khambhala
> i-hack-at-DeepRoot Linux
> Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
> http://www.deeproot.in, +91 80 4089 0000
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
Re: [users@httpd] Apache Tunning
Posted by kulbir Saini <ku...@gmail.com>.
Thanks Tony,
will work on the suggestion and will let you know..
Kulbir
On Mon, Mar 16, 2009 at 5:58 PM, Anthony J. Biacco <
abiacco@formatdynamics.com> wrote:
> Your math is still off. ServerLimit x ThreadsPerChild = 200 x 25 = 5000.
> This does not equal your MaxClients of 1000. Try a ServerLimit of 20 and
> ThreadsPerChild of 50.
>
>
>
> If you’re vmstat “r” column is high, chances are you’re getting a lot of
> requests. What’s your apache requests/second? (check the apache
> server-status webpage). That will also tell you what the incoming
> connections are actually doing. Maybe you have EnableSendFile on and your
> system doesn’t support it. Maybe you have EnableMMAP on and your system
> doesn’t support it. Maybe you’re pulling files over NFS over a slow link?
>
> Until you look at the server-status page, you won’t know.
>
> You should also run an strace on your apache processes to find out some
> more information, see if there’s a lot of extraneous calls or error in
> there.
>
> strace -f -F -v –p <an_apache_child_pid>
>
>
>
> And you should still see what all these numbers look like with keepalives
> off.
>
>
>
> -Tony
>
> ---------------------------
>
> Manager, IT Operations
>
> Format Dynamics, Inc.
>
> 303-573-1800x27
>
> abiacco@formatdynamics.com
>
> http://www.formatdynamics.com
>
>
>
> *From:* kulbir Saini [mailto:kulbir.saini1@gmail.com]
> *Sent:* Friday, March 13, 2009 9:08 PM
>
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] Apache Tunning
>
>
>
> Hi All
>
> Thanks.
>
> I also agree lowering MaxRequestsPerChild will keep busy apache in killing
> and recreating child process. I dont know what Math i worked, i reconfigured
> both of the apache instances on the server with following -
>
> <IfModule worker.c>
> ServerLimit 200
> StartServers 2
> MaxClients 1000
> MinSpareThreads 75
> MaxSpareThreads 250
> ThreadsPerChild 25
> MaxRequestsPerChild 20000
> </IfModule>
>
> KeepAliveTimeout 5
>
> There was rise in load, teh system snapshot is -
>
> [root@cinschpr35 root]# top
> 5:46pm up 257 days, 7:09, 5 users, load average: 5.70, 5.31, 5.15
> 614 processes: 606 sleeping, 8 running, 0 zombie, 0 stopped
> CPU0 states: 98.2% user, 1.1% system, 0.0% nice, 0.1% idle
> CPU1 states: 99.4% user, 0.0% system, 0.0% nice, 0.1% idle
> CPU2 states: 99.4% user, 0.1% system, 0.0% nice, 0.0% idle
> CPU3 states: 98.4% user, 1.0% system, 0.0% nice, 0.0% idle
> Mem: 3927672K av, 3922000K used, 5672K free, 5196K shrd, 1363088K
> buff
> Swap: 1048536K av, 736K used, 1047800K free 2112964K
> cached
>
> PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME
> COMMAND
> 32006 apache0 25 0 6796 6796 4092 R 99.8 0.1
> 213:21 httpd
> 2306 apache0 25 0 6624 6624 4100 R 99.4
> 0.1 136:42 httpd
> 2298 apache0 25 0 6624 6624 4100 R 97.2
> 0.1 135:39 httpd
> 2308 apache0 25 0 6624 6624 4100 R 95.4
> 0.1 135:05 httpd
> 17059 tomcat1 15 0 82432 80M 9932 S 1.1 2.0
> 9:10 java
> 14678 tomcat0 15 0 101M 101M 31464 S 1.1 2.6
> 6:32 java
> 16228 root 15 0 1488 1488 836 R 1.1
> 0.0 0:00 top
> 19850 tomcat1 15 0 82432 80M 9932 S 0.9 2.0
> 6:16 java
> 1110 tomcat0 15 0 101M 101M 31464 S 0.5
> 2.6 10:19 java
> 23605 tomcat0 15 0 101M 101M 31464 S 0.5 2.6
> 7:31 java
>
> #free -m
> total used free shared buffers cached
> Mem: 3835 3828 7 5 1335 2059
> -/+ buffers/cache: 433 3402
> Swap: 1023 0 1023
>
>
> procs memory swap
> io system cpu
> r b w swpd free buff cache si so bi bo
> in cs us sy id
> 5 0 1 736 8236 1367124 2108452 0 0 1 12 3 1 11
> 5 13
> 4 0 0 736 8156 1367132 2108460 0 0 0 172 370 404 98
> 2 0
> 4 0 1 736 8172 1367132 2108468 0 0 0 0 281 309 99
> 1 0
> 4 0 1 736 8168 1367132 2108480 0 0 0 162 288 366 100
> 0 0
> 5 0 1 736 8128 1367132 2108488 0 0 0 0 287 342 99
> 1 0
> 4 0 1 736 8136 1367132 2108496 0 0 0 148 286 322 100
> 1 0
> 5 0 1 736 8180 1367132 2108504 0 0 0 0 275 332 98
> 2 0
> 4 0 2 736 8148 1367132 2108512 0 0 0 10 267 326 99
> 1 0
> 4 0 1 736 8184 1367136 2108520 0 0 0 190 288 357 99
> 1 0
> 4 0 0 736 8104 1367136 2108536 0 0 0 10 298 404 99
> 1 0
> 4 0 2 736 7980 1367140 2108540 0 0 0 254 332 414 99
> 1 0
> 4 0 0 736 7968 1367140 2108548 0 0 0 20 286 408 98
> 2 0
> 5 0 1 736 7972 1367140 2108560 0 0 0 0 346 418 99
> 1 0
> 4 0 1 736 7992 1367144 2108568 0 0 0 216 315 371 100
> 0 0
> 5 0 0 736 8004 1367144 2108576 0 0 0 0 285 358 100
> 0 0
> 5 0 0 736 7956 1367144 2108588 0 0 0 158 333 392 100
> 0 0
> 6 0 2 736 7928 1367144 2108596 0 0 0 0 326 383 99
> 1 0
> 6 0 2 736 8064 1367144 2108604 0 0 0 0 291 356 100
> 0 0
> 4 0 0 736 8056 1367148 2108616 0 0 0 180 301 376 99
> 1 0
> 4 0 1 736 8016 1367148 2108624 0 0 0 34 335 413 99
> 1 0
>
>
> Above, i can see two things happened-
>
> 1> in "top" output teh httpd process eating CPU has high "TIME" value. why?
> 2> the vmstat output value of "r" increases. Why?
>
> Thanks in advance
>
>
> Kulbir
>
>
> On Fri, Mar 13, 2009 at 6:38 PM, Tadeu Alves <ta...@gmail.com> wrote:
>
> i forget the other stuff i'm using moodle with some images werving with
> eaccelerator running with php and i you want i can send a conf file about
> mysql, php and apache if you would like to.
>
> On Fri, Mar 13, 2009 at 2:45 PM, Anthony J. Biacco <
> abiacco@formatdynamics.com> wrote:
>
> 1. I have to rail totally against this. The more you lower
> MaxRequestsPerChild, the more often apache is killing and recreating a child
> process. At numbers as low as 2000 or lower, you’re starting to defeat the
> whole purpose of using the worker mpm.
>
> >=50% of apache’s time is going to be spent managing child processes on a
> high traffic site. MaxRequestsPerChild should either be 0 or something very
> high. IF your process memory usage gets higher and higher, then you have a
> memory leak somewhere.
>
> 2. Don’t use ThreadLimit, stick with ThreadsPerChild
>
> 3. You MaxClients doesn’t sync up to your other numbers. MaxClients is
> going to be ServerLimit x ThreadsPerChild. So for you, 1500. If you want to
> serve 1500 concurrent reqs, then set MaxClients to match this at 1500. If
> you want 500, then change ServerLimit,StartServers and ThreadsPerChild so
> the math is right. For instance, ServerLimit 10, StartServers 5,
> ThreadsPerChild 50 will be you a MaxClients of 500.
>
> If you give us your server parameters (cpu, memory, modules loaded, apache
> rss usage, types of files served), we’d be able to better recommend numbers
> for what your server can support.
>
>
>
> -Tony
>
> ---------------------------
>
> Manager, IT Operations
>
> Format Dynamics, Inc.
>
> 303-573-1800x27
>
> abiacco@formatdynamics.com
>
> http://www.formatdynamics.com
>
>
>
> *From:* Tadeu Alves [mailto:tadeudca@gmail.com]
> *Sent:* Friday, March 13, 2009 8:45 AM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] Apache Tunning
>
>
>
> nice one. Getting on this hook, in my server we run moodle i dunno if you
> guys know about it and a very high hits/second i wan't to know if going down
> about MaxRequestsPerChild 500 will be good to performance and any idea about
> changing my server variables to make it support more concurrent connections
>
>
>
> ########################################
>
> <IfModule worker.c>
> ServerLimit 30
> ThreadLimit 70
> StartServers 20
> MaxClients 500
> MinSpareThreads 10
> MaxSpareThreads 15
> ThreadsPerChild 50
> MaxRequestsPerChild 2000
> MaxMemFree 5000
> #ReceiveBufferSize 714400 (not using anymore)
>
>
>
> #################################
>
>
>
>
>
> On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala <ga...@deeproot.co.in>
> wrote:
>
> Hi Kulbir,
>
>
>
> Gaurav wrote:
>
> Tadeu Alves wrote:
>
> i thibk that you can down the variable
> MaxRequestsPerChild 20000 to 2000 it's too much and if the child process
> keeps the request well i't grows bigger and bigger in memory
>
>
> Even 2000 is too much. Various high load,high traffic servers also don't
> have this much high value.
>
>
>
> Found this: http://rimuhosting.com/howto/memory.jsp may be useful to you.
>
>
>
>
> --
> Cheers,
>
>
> Gaurav Khambhala
> i-hack-at-DeepRoot Linux
> Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
> http://www.deeproot.in, +91 80 4089 0000
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
>
>
>
>
RE: [users@httpd] Apache Tunning
Posted by "Anthony J. Biacco" <ab...@formatdynamics.com>.
Your math is still off. ServerLimit x ThreadsPerChild = 200 x 25 =
5000. This does not equal your MaxClients of 1000. Try a ServerLimit of
20 and ThreadsPerChild of 50.
If you're vmstat "r" column is high, chances are you're getting a lot of
requests. What's your apache requests/second? (check the apache
server-status webpage). That will also tell you what the incoming
connections are actually doing. Maybe you have EnableSendFile on and
your system doesn't support it. Maybe you have EnableMMAP on and your
system doesn't support it. Maybe you're pulling files over NFS over a
slow link?
Until you look at the server-status page, you won't know.
You should also run an strace on your apache processes to find out some
more information, see if there's a lot of extraneous calls or error in
there.
strace -f -F -v -p <an_apache_child_pid>
And you should still see what all these numbers look like with
keepalives off.
-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abiacco@formatdynamics.com <ma...@formatdynamics.com>
http://www.formatdynamics.com <http://www.formatdynamics.com/>
From: kulbir Saini [mailto:kulbir.saini1@gmail.com]
Sent: Friday, March 13, 2009 9:08 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache Tunning
Hi All
Thanks.
I also agree lowering MaxRequestsPerChild will keep busy apache in
killing and recreating child process. I dont know what Math i worked, i
reconfigured both of the apache instances on the server with following
-
<IfModule worker.c>
ServerLimit 200
StartServers 2
MaxClients 1000
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestsPerChild 20000
</IfModule>
KeepAliveTimeout 5
There was rise in load, teh system snapshot is -
[root@cinschpr35 root]# top
5:46pm up 257 days, 7:09, 5 users, load average: 5.70, 5.31, 5.15
614 processes: 606 sleeping, 8 running, 0 zombie, 0 stopped
CPU0 states: 98.2% user, 1.1% system, 0.0% nice, 0.1% idle
CPU1 states: 99.4% user, 0.0% system, 0.0% nice, 0.1% idle
CPU2 states: 99.4% user, 0.1% system, 0.0% nice, 0.0% idle
CPU3 states: 98.4% user, 1.0% system, 0.0% nice, 0.0% idle
Mem: 3927672K av, 3922000K used, 5672K free, 5196K shrd, 1363088K
buff
Swap: 1048536K av, 736K used, 1047800K free 2112964K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME
COMMAND
32006 apache0 25 0 6796 6796 4092 R 99.8 0.1
213:21 httpd
2306 apache0 25 0 6624 6624 4100 R 99.4 0.1
136:42 httpd
2298 apache0 25 0 6624 6624 4100 R 97.2 0.1
135:39 httpd
2308 apache0 25 0 6624 6624 4100 R 95.4 0.1
135:05 httpd
17059 tomcat1 15 0 82432 80M 9932 S 1.1 2.0
9:10 java
14678 tomcat0 15 0 101M 101M 31464 S 1.1 2.6
6:32 java
16228 root 15 0 1488 1488 836 R 1.1
0.0 0:00 top
19850 tomcat1 15 0 82432 80M 9932 S 0.9 2.0
6:16 java
1110 tomcat0 15 0 101M 101M 31464 S 0.5 2.6
10:19 java
23605 tomcat0 15 0 101M 101M 31464 S 0.5 2.6
7:31 java
#free -m
total used free shared buffers
cached
Mem: 3835 3828 7 5 1335
2059
-/+ buffers/cache: 433 3402
Swap: 1023 0 1023
procs memory swap
io system cpu
r b w swpd free buff cache si so bi bo
in cs us sy id
5 0 1 736 8236 1367124 2108452 0 0 1 12 3 1
11 5 13
4 0 0 736 8156 1367132 2108460 0 0 0 172 370 404
98 2 0
4 0 1 736 8172 1367132 2108468 0 0 0 0 281 309
99 1 0
4 0 1 736 8168 1367132 2108480 0 0 0 162 288 366
100 0 0
5 0 1 736 8128 1367132 2108488 0 0 0 0 287 342
99 1 0
4 0 1 736 8136 1367132 2108496 0 0 0 148 286 322
100 1 0
5 0 1 736 8180 1367132 2108504 0 0 0 0 275 332
98 2 0
4 0 2 736 8148 1367132 2108512 0 0 0 10 267 326
99 1 0
4 0 1 736 8184 1367136 2108520 0 0 0 190 288 357
99 1 0
4 0 0 736 8104 1367136 2108536 0 0 0 10 298 404
99 1 0
4 0 2 736 7980 1367140 2108540 0 0 0 254 332 414
99 1 0
4 0 0 736 7968 1367140 2108548 0 0 0 20 286 408
98 2 0
5 0 1 736 7972 1367140 2108560 0 0 0 0 346 418
99 1 0
4 0 1 736 7992 1367144 2108568 0 0 0 216 315 371
100 0 0
5 0 0 736 8004 1367144 2108576 0 0 0 0 285 358
100 0 0
5 0 0 736 7956 1367144 2108588 0 0 0 158 333 392
100 0 0
6 0 2 736 7928 1367144 2108596 0 0 0 0 326 383
99 1 0
6 0 2 736 8064 1367144 2108604 0 0 0 0 291 356
100 0 0
4 0 0 736 8056 1367148 2108616 0 0 0 180 301 376
99 1 0
4 0 1 736 8016 1367148 2108624 0 0 0 34 335 413
99 1 0
Above, i can see two things happened-
1> in "top" output teh httpd process eating CPU has high "TIME" value.
why?
2> the vmstat output value of "r" increases. Why?
Thanks in advance
Kulbir
On Fri, Mar 13, 2009 at 6:38 PM, Tadeu Alves <ta...@gmail.com> wrote:
i forget the other stuff i'm using moodle with some images werving with
eaccelerator running with php and i you want i can send a conf file
about mysql, php and apache if you would like to.
On Fri, Mar 13, 2009 at 2:45 PM, Anthony J. Biacco
<ab...@formatdynamics.com> wrote:
1. I have to rail totally against this. The more you lower
MaxRequestsPerChild, the more often apache is killing and recreating a
child process. At numbers as low as 2000 or lower, you're starting to
defeat the whole purpose of using the worker mpm.
>=50% of apache's time is going to be spent managing child
processes on a high traffic site. MaxRequestsPerChild should either be 0
or something very high. IF your process memory usage gets higher and
higher, then you have a memory leak somewhere.
2. Don't use ThreadLimit, stick with ThreadsPerChild
3. You MaxClients doesn't sync up to your other numbers.
MaxClients is going to be ServerLimit x ThreadsPerChild. So for you,
1500. If you want to serve 1500 concurrent reqs, then set MaxClients to
match this at 1500. If you want 500, then change
ServerLimit,StartServers and ThreadsPerChild so the math is right. For
instance, ServerLimit 10, StartServers 5, ThreadsPerChild 50 will be you
a MaxClients of 500.
If you give us your server parameters (cpu, memory, modules
loaded, apache rss usage, types of files served), we'd be able to better
recommend numbers for what your server can support.
-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abiacco@formatdynamics.com
http://www.formatdynamics.com <http://www.formatdynamics.com/>
From: Tadeu Alves [mailto:tadeudca@gmail.com]
Sent: Friday, March 13, 2009 8:45 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache Tunning
nice one. Getting on this hook, in my server we run moodle i
dunno if you guys know about it and a very high hits/second i wan't to
know if going down about MaxRequestsPerChild 500 will be good to
performance and any idea about changing my server variables to make it
support more concurrent connections
########################################
<IfModule worker.c>
ServerLimit 30
ThreadLimit 70
StartServers 20
MaxClients 500
MinSpareThreads 10
MaxSpareThreads 15
ThreadsPerChild 50
MaxRequestsPerChild 2000
MaxMemFree 5000
#ReceiveBufferSize 714400 (not using anymore)
#################################
On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala
<ga...@deeproot.co.in> wrote:
Hi Kulbir,
Gaurav wrote:
Tadeu Alves wrote:
i thibk that you can down the variable
MaxRequestsPerChild 20000 to 2000 it's too much and if the
child process keeps the request well i't grows bigger and bigger in
memory
Even 2000 is too much. Various high load,high traffic servers
also don't have this much high value.
Found this: http://rimuhosting.com/howto/memory.jsp may be
useful to you.
--
Cheers,
Gaurav Khambhala
i-hack-at-DeepRoot Linux
Getting GNU/Linux to work for you. Faster. Better. Today. Every
way.
http://www.deeproot.in <http://www.deeproot.in/> , +91 80 4089
0000
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache Tunning
Posted by kulbir Saini <ku...@gmail.com>.
Hi All
Thanks.
I also agree lowering MaxRequestsPerChild will keep busy apache in killing
and recreating child process. I dont know what Math i worked, i reconfigured
both of the apache instances on the server with following -
<IfModule worker.c>
ServerLimit 200
StartServers 2
MaxClients 1000
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestsPerChild 20000
</IfModule>
KeepAliveTimeout 5
There was rise in load, teh system snapshot is -
[root@cinschpr35 root]# top
5:46pm up 257 days, 7:09, 5 users, load average: 5.70, 5.31, 5.15
614 processes: 606 sleeping, 8 running, 0 zombie, 0 stopped
CPU0 states: 98.2% user, 1.1% system, 0.0% nice, 0.1% idle
CPU1 states: 99.4% user, 0.0% system, 0.0% nice, 0.1% idle
CPU2 states: 99.4% user, 0.1% system, 0.0% nice, 0.0% idle
CPU3 states: 98.4% user, 1.0% system, 0.0% nice, 0.0% idle
Mem: 3927672K av, 3922000K used, 5672K free, 5196K shrd, 1363088K
buff
Swap: 1048536K av, 736K used, 1047800K free 2112964K
cached
PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME
COMMAND
32006 apache0 25 0 6796 6796 4092 R 99.8 0.1
213:21 httpd
2306 apache0 25 0 6624 6624 4100 R 99.4 0.1
136:42 httpd
2298 apache0 25 0 6624 6624 4100 R 97.2 0.1
135:39 httpd
2308 apache0 25 0 6624 6624 4100 R 95.4 0.1
135:05 httpd
17059 tomcat1 15 0 82432 80M 9932 S 1.1 2.0
9:10 java
14678 tomcat0 15 0 101M 101M 31464 S 1.1 2.6
6:32 java
16228 root 15 0 1488 1488 836 R 1.1
0.0 0:00 top
19850 tomcat1 15 0 82432 80M 9932 S 0.9 2.0
6:16 java
1110 tomcat0 15 0 101M 101M 31464 S 0.5 2.6
10:19 java
23605 tomcat0 15 0 101M 101M 31464 S 0.5 2.6
7:31 java
#free -m
total used free shared buffers cached
Mem: 3835 3828 7 5 1335 2059
-/+ buffers/cache: 433 3402
Swap: 1023 0 1023
procs memory swap
io system cpu
r b w swpd free buff cache si so bi bo
in cs us sy id
5 0 1 736 8236 1367124 2108452 0 0 1 12 3 1 11
5 13
4 0 0 736 8156 1367132 2108460 0 0 0 172 370 404 98
2 0
4 0 1 736 8172 1367132 2108468 0 0 0 0 281 309 99
1 0
4 0 1 736 8168 1367132 2108480 0 0 0 162 288 366 100
0 0
5 0 1 736 8128 1367132 2108488 0 0 0 0 287 342 99
1 0
4 0 1 736 8136 1367132 2108496 0 0 0 148 286 322 100
1 0
5 0 1 736 8180 1367132 2108504 0 0 0 0 275 332 98
2 0
4 0 2 736 8148 1367132 2108512 0 0 0 10 267 326 99
1 0
4 0 1 736 8184 1367136 2108520 0 0 0 190 288 357 99
1 0
4 0 0 736 8104 1367136 2108536 0 0 0 10 298 404 99
1 0
4 0 2 736 7980 1367140 2108540 0 0 0 254 332 414 99
1 0
4 0 0 736 7968 1367140 2108548 0 0 0 20 286 408 98
2 0
5 0 1 736 7972 1367140 2108560 0 0 0 0 346 418 99
1 0
4 0 1 736 7992 1367144 2108568 0 0 0 216 315 371 100
0 0
5 0 0 736 8004 1367144 2108576 0 0 0 0 285 358 100
0 0
5 0 0 736 7956 1367144 2108588 0 0 0 158 333 392 100
0 0
6 0 2 736 7928 1367144 2108596 0 0 0 0 326 383 99
1 0
6 0 2 736 8064 1367144 2108604 0 0 0 0 291 356 100
0 0
4 0 0 736 8056 1367148 2108616 0 0 0 180 301 376 99
1 0
4 0 1 736 8016 1367148 2108624 0 0 0 34 335 413 99
1 0
Above, i can see two things happened-
1> in "top" output teh httpd process eating CPU has high "TIME" value. why?
2> the vmstat output value of "r" increases. Why?
Thanks in advance
Kulbir
On Fri, Mar 13, 2009 at 6:38 PM, Tadeu Alves <ta...@gmail.com> wrote:
> i forget the other stuff i'm using moodle with some images werving with
> eaccelerator running with php and i you want i can send a conf file about
> mysql, php and apache if you would like to.
>
> On Fri, Mar 13, 2009 at 2:45 PM, Anthony J. Biacco <
> abiacco@formatdynamics.com> wrote:
>
>> 1. I have to rail totally against this. The more you lower
>> MaxRequestsPerChild, the more often apache is killing and recreating a child
>> process. At numbers as low as 2000 or lower, you’re starting to defeat the
>> whole purpose of using the worker mpm.
>>
>> >=50% of apache’s time is going to be spent managing child processes on a
>> high traffic site. MaxRequestsPerChild should either be 0 or something very
>> high. IF your process memory usage gets higher and higher, then you have a
>> memory leak somewhere.
>>
>> 2. Don’t use ThreadLimit, stick with ThreadsPerChild
>>
>> 3. You MaxClients doesn’t sync up to your other numbers. MaxClients is
>> going to be ServerLimit x ThreadsPerChild. So for you, 1500. If you want to
>> serve 1500 concurrent reqs, then set MaxClients to match this at 1500. If
>> you want 500, then change ServerLimit,StartServers and ThreadsPerChild so
>> the math is right. For instance, ServerLimit 10, StartServers 5,
>> ThreadsPerChild 50 will be you a MaxClients of 500.
>>
>> If you give us your server parameters (cpu, memory, modules loaded, apache
>> rss usage, types of files served), we’d be able to better recommend numbers
>> for what your server can support.
>>
>>
>>
>> -Tony
>>
>> ---------------------------
>>
>> Manager, IT Operations
>>
>> Format Dynamics, Inc.
>>
>> 303-573-1800x27
>>
>> abiacco@formatdynamics.com
>>
>> http://www.formatdynamics.com
>>
>>
>>
>> *From:* Tadeu Alves [mailto:tadeudca@gmail.com]
>> *Sent:* Friday, March 13, 2009 8:45 AM
>> *To:* users@httpd.apache.org
>> *Subject:* Re: [users@httpd] Apache Tunning
>>
>>
>>
>> nice one. Getting on this hook, in my server we run moodle i dunno if you
>> guys know about it and a very high hits/second i wan't to know if going down
>> about MaxRequestsPerChild 500 will be good to performance and any idea about
>> changing my server variables to make it support more concurrent connections
>>
>>
>>
>> ########################################
>>
>> <IfModule worker.c>
>> ServerLimit 30
>> ThreadLimit 70
>> StartServers 20
>> MaxClients 500
>> MinSpareThreads 10
>> MaxSpareThreads 15
>> ThreadsPerChild 50
>> MaxRequestsPerChild 2000
>> MaxMemFree 5000
>> #ReceiveBufferSize 714400 (not using anymore)
>>
>>
>>
>> #################################
>>
>>
>>
>>
>>
>> On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala <ga...@deeproot.co.in>
>> wrote:
>>
>> Hi Kulbir,
>>
>>
>>
>> Gaurav wrote:
>>
>> Tadeu Alves wrote:
>>
>> i thibk that you can down the variable
>> MaxRequestsPerChild 20000 to 2000 it's too much and if the child process
>> keeps the request well i't grows bigger and bigger in memory
>>
>>
>> Even 2000 is too much. Various high load,high traffic servers also don't
>> have this much high value.
>>
>>
>>
>> Found this: http://rimuhosting.com/howto/memory.jsp may be useful to you.
>>
>>
>>
>>
>> --
>> Cheers,
>>
>>
>> Gaurav Khambhala
>> i-hack-at-DeepRoot Linux
>> Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
>> http://www.deeproot.in, +91 80 4089 0000
>>
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> " from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>
>>
>>
>
>
Re: [users@httpd] Apache Tunning
Posted by Tadeu Alves <ta...@gmail.com>.
i forget the other stuff i'm using moodle with some images werving with
eaccelerator running with php and i you want i can send a conf file about
mysql, php and apache if you would like to.
On Fri, Mar 13, 2009 at 2:45 PM, Anthony J. Biacco <
abiacco@formatdynamics.com> wrote:
> 1. I have to rail totally against this. The more you lower
> MaxRequestsPerChild, the more often apache is killing and recreating a child
> process. At numbers as low as 2000 or lower, you’re starting to defeat the
> whole purpose of using the worker mpm.
>
> >=50% of apache’s time is going to be spent managing child processes on a
> high traffic site. MaxRequestsPerChild should either be 0 or something very
> high. IF your process memory usage gets higher and higher, then you have a
> memory leak somewhere.
>
> 2. Don’t use ThreadLimit, stick with ThreadsPerChild
>
> 3. You MaxClients doesn’t sync up to your other numbers. MaxClients is
> going to be ServerLimit x ThreadsPerChild. So for you, 1500. If you want to
> serve 1500 concurrent reqs, then set MaxClients to match this at 1500. If
> you want 500, then change ServerLimit,StartServers and ThreadsPerChild so
> the math is right. For instance, ServerLimit 10, StartServers 5,
> ThreadsPerChild 50 will be you a MaxClients of 500.
>
> If you give us your server parameters (cpu, memory, modules loaded, apache
> rss usage, types of files served), we’d be able to better recommend numbers
> for what your server can support.
>
>
>
> -Tony
>
> ---------------------------
>
> Manager, IT Operations
>
> Format Dynamics, Inc.
>
> 303-573-1800x27
>
> abiacco@formatdynamics.com
>
> http://www.formatdynamics.com
>
>
>
> *From:* Tadeu Alves [mailto:tadeudca@gmail.com]
> *Sent:* Friday, March 13, 2009 8:45 AM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] Apache Tunning
>
>
>
> nice one. Getting on this hook, in my server we run moodle i dunno if you
> guys know about it and a very high hits/second i wan't to know if going down
> about MaxRequestsPerChild 500 will be good to performance and any idea about
> changing my server variables to make it support more concurrent connections
>
>
>
> ########################################
>
> <IfModule worker.c>
> ServerLimit 30
> ThreadLimit 70
> StartServers 20
> MaxClients 500
> MinSpareThreads 10
> MaxSpareThreads 15
> ThreadsPerChild 50
> MaxRequestsPerChild 2000
> MaxMemFree 5000
> #ReceiveBufferSize 714400 (not using anymore)
>
>
>
> #################################
>
>
>
>
>
> On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala <ga...@deeproot.co.in>
> wrote:
>
> Hi Kulbir,
>
>
>
> Gaurav wrote:
>
> Tadeu Alves wrote:
>
> i thibk that you can down the variable
> MaxRequestsPerChild 20000 to 2000 it's too much and if the child process
> keeps the request well i't grows bigger and bigger in memory
>
>
> Even 2000 is too much. Various high load,high traffic servers also don't
> have this much high value.
>
>
>
> Found this: http://rimuhosting.com/howto/memory.jsp may be useful to you.
>
>
>
>
> --
> Cheers,
>
>
> Gaurav Khambhala
> i-hack-at-DeepRoot Linux
> Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
> http://www.deeproot.in, +91 80 4089 0000
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>
RE: [users@httpd] Apache Tunning
Posted by "Anthony J. Biacco" <ab...@formatdynamics.com>.
1. I have to rail totally against this. The more you lower
MaxRequestsPerChild, the more often apache is killing and recreating a
child process. At numbers as low as 2000 or lower, you're starting to
defeat the whole purpose of using the worker mpm.
>=50% of apache's time is going to be spent managing child processes on
a high traffic site. MaxRequestsPerChild should either be 0 or something
very high. IF your process memory usage gets higher and higher, then you
have a memory leak somewhere.
2. Don't use ThreadLimit, stick with ThreadsPerChild
3. You MaxClients doesn't sync up to your other numbers. MaxClients is
going to be ServerLimit x ThreadsPerChild. So for you, 1500. If you want
to serve 1500 concurrent reqs, then set MaxClients to match this at
1500. If you want 500, then change ServerLimit,StartServers and
ThreadsPerChild so the math is right. For instance, ServerLimit 10,
StartServers 5, ThreadsPerChild 50 will be you a MaxClients of 500.
If you give us your server parameters (cpu, memory, modules loaded,
apache rss usage, types of files served), we'd be able to better
recommend numbers for what your server can support.
-Tony
---------------------------
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abiacco@formatdynamics.com <ma...@formatdynamics.com>
http://www.formatdynamics.com <http://www.formatdynamics.com/>
From: Tadeu Alves [mailto:tadeudca@gmail.com]
Sent: Friday, March 13, 2009 8:45 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Apache Tunning
nice one. Getting on this hook, in my server we run moodle i dunno if
you guys know about it and a very high hits/second i wan't to know if
going down about MaxRequestsPerChild 500 will be good to performance and
any idea about changing my server variables to make it support more
concurrent connections
########################################
<IfModule worker.c>
ServerLimit 30
ThreadLimit 70
StartServers 20
MaxClients 500
MinSpareThreads 10
MaxSpareThreads 15
ThreadsPerChild 50
MaxRequestsPerChild 2000
MaxMemFree 5000
#ReceiveBufferSize 714400 (not using anymore)
#################################
On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala
<ga...@deeproot.co.in> wrote:
Hi Kulbir,
Gaurav wrote:
Tadeu Alves wrote:
i thibk that you can down the variable
MaxRequestsPerChild 20000 to 2000 it's too much and if the child
process keeps the request well i't grows bigger and bigger in memory
Even 2000 is too much. Various high load,high traffic servers also don't
have this much high value.
Found this: http://rimuhosting.com/howto/memory.jsp may be useful to
you.
--
Cheers,
Gaurav Khambhala
i-hack-at-DeepRoot Linux
Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
http://www.deeproot.in <http://www.deeproot.in/> , +91 80 4089 0000
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache Tunning
Posted by Tadeu Alves <ta...@gmail.com>.
nice one. Getting on this hook, in my server we run moodle i dunno if you
guys know about it and a very high hits/second i wan't to know if going down
about MaxRequestsPerChild 500 will be good to performance and any idea about
changing my server variables to make it support more concurrent connections
########################################
<IfModule worker.c>
ServerLimit 30
ThreadLimit 70
StartServers 20
MaxClients 500
MinSpareThreads 10
MaxSpareThreads 15
ThreadsPerChild 50
MaxRequestsPerChild 2000
MaxMemFree 5000
#ReceiveBufferSize 714400 (not using anymore)
#################################
On Fri, Mar 13, 2009 at 5:41 AM, Gaurav Khambhala <ga...@deeproot.co.in>wrote:
> Hi Kulbir,
>
> Gaurav wrote:
>
>> Tadeu Alves wrote:
>>
>>> i thibk that you can down the variable
>>> MaxRequestsPerChild 20000 to 2000 it's too much and if the child
>>> process keeps the request well i't grows bigger and bigger in memory
>>>
>>
>> Even 2000 is too much. Various high load,high traffic servers also don't
>> have this much high value.
>>
>
> Found this: http://rimuhosting.com/howto/memory.jsp may be useful to you.
>
>
>
>
> --
> Cheers,
>
> Gaurav Khambhala
> i-hack-at-DeepRoot Linux
> Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
> http://www.deeproot.in, +91 80 4089 0000
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
Re: [users@httpd] Apache Tunning
Posted by Gaurav Khambhala <ga...@deeproot.co.in>.
Hi Kulbir,
Gaurav wrote:
> Tadeu Alves wrote:
>> i thibk that you can down the variable
>>
>> MaxRequestsPerChild 20000 to 2000 it's too much and if the child
>> process keeps the request well i't grows bigger and bigger in memory
>
> Even 2000 is too much. Various high load,high traffic servers also
> don't have this much high value.
Found this: http://rimuhosting.com/howto/memory.jsp may be useful to you.
--
Cheers,
Gaurav Khambhala
i-hack-at-DeepRoot Linux
Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
http://www.deeproot.in, +91 80 4089 0000
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache Tunning
Posted by Gaurav <ga...@deeproot.co.in>.
Tadeu Alves wrote:
> i thibk that you can down the variable
>
> MaxRequestsPerChild 20000 to 2000 it's too much and if the child
> process keeps the request well i't grows bigger and bigger in memory
Even 2000 is too much. Various high load,high traffic servers also don't
have this much high value.
> KeepAlive is ON. i put on my server off
>
> this too eats a huge amount of memory.
May be its true. But KeepAlive ON will help you to serve more files per
tcp handshake. With this option on http client can request more files.
>
> my server conf with 8gs and dual xeon processors with 300 simultaneous
> connections and about 8k-12k hits/min
> <IfModule worker.c>
> ServerLimit 30
> ThreadLimit 70
> StartServers 20
> MaxClients 500
> MinSpareThreads 10
> MaxSpareThreads 15
> ThreadsPerChild 50
> MaxRequestsPerChild 2000
> MaxMemFree 5000
> ReceiveBufferSize 714400
--
Thanks & Regards,
Gaurav Khambhala
i-hack-at-DeepRoot Linux
Getting GNU/Linux to work for you. Faster. Better. Today. Every way.
http://www.deeproot.in, +91 80 4089 0000
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Apache Tunning
Posted by Tadeu Alves <ta...@gmail.com>.
i thibk that you can down the variable
MaxRequestsPerChild 20000 to 2000 it's too much and if the child process
keeps the request well i't grows bigger and bigger in memory
KeepAlive is ON. i put on my server off
this too eats a huge amount of memory.
my server conf with 8gs and dual xeon processors with 300 simultaneous
connections and about 8k-12k hits/min
<IfModule worker.c>
ServerLimit 30
ThreadLimit 70
StartServers 20
MaxClients 500
MinSpareThreads 10
MaxSpareThreads 15
ThreadsPerChild 50
MaxRequestsPerChild 2000
MaxMemFree 5000
ReceiveBufferSize 714400
On Thu, Mar 12, 2009 at 1:05 PM, kulbir Saini <ku...@gmail.com>wrote:
> Issue- We have web server with two instances of apache running. Its with
> Worker MPM. Traffic is around 4200 hits/min on the server(both instances).
> We see server getting into high load raises above 5-6 and most of the CPU
> used is in "user space" by httpd process. Its a 2Dual core CPU box. when
> load reaches around 5, i checked vmstat and it gives process in cpu run
> queue above 4 or 5. Since its a prod box we get alert and need to bounce.
> The server environment is-
>
> Environment - 2 apache instances with corresponding tomcat instances.
> Applciation - Used to server a simple .pac file.
>
>
>
>
> Scenario -
>
> OS - RHEL2AS ( 2.4.9-e.40enterprise #1 SMP)
> apache- Apache/2.0.48
> arch - 32bit
> memory - 4GM + 1GB swap
>
> httpd.conf (worker setting original)
>
> <IfModule worker.c>
> #ServerLimit 25
> StartServers 2
> MaxClients 300
> MinSpareThreads 75
> MaxSpareThreads 250
> ThreadsPerChild 25
> MaxRequestsPerChild 20000
> </IfModule>
>
> KeepAlive is ON. KeaapAliveTime is default(15)
>
> the httpd "RSS" value is appx 4.2MB
>
> Need help in tunning apache so that best use of Hardware resources can be
> made.
>
> Thanks
> Kulbir