-3

I have 2 servers for my website :

  • One server 256GO RAM 20c/40t for MySQL
  • One server 256GO RAM 20c/40t for Apache

The MySQL server is always ok (30-50% of CPU is used).

But the Apache server become SUPERSLOW when my website start to get 10,000 simultaneous connected visitors (5,000 pages loaded per minute). What is strange is than this server doesn't reach its limit yet because the memory charge of the CPU is around 20-30%.

This is what top return on the Apache server (when the website is superslow with 10,000 visitors).

top - 22:04:17 up 22:34,  1 user,  load average: 12.61, 13.59, 13.47
Tasks: 2139 total,  20 running, 2119 sleeping,   0 stopped,   0 zombie
%Cpu(s): 28.2 us,  7.2 sy,  0.0 ni, 63.0 id,  0.0 wa,  0.0 hi,  1.6 si,  0.0 st
KiB Mem : 26410644+total, 17146396+free,  8632064 used, 84010416 buff/cache
KiB Swap:  1047548 total,  1047548 free,        0 used. 25449820+avail Mem

It's like there is a limit one the CPU charge of this server.

And this is the configation of the Apache server:

keepalive: Off
keepalivetimeout: 2
maxclients: 3000
maxkeepaliverequests: 1000
maxrequestsperchild: 15000
maxspareservers: 300
minspareservers: 150
serverlimit: 3000
startservers: 1000
timeout: 300

And I should precise than yesterday I was on a 128GO RAM for the Apache server and the website could support 13,000 simultaneous connected visitors before it started to become superslow. So I decided to change for a 256GO RAM, but the result is worst...

Any ideas?

I'm using WHM.

(Sorry for my english)

1 Answers1

2

"The MaxClients directive sets the limit on the number of simultaneous requests that will be served. Any connection attempts over the MaxClients limit will normally be queued, up to a number based on the ListenBacklog directive. Once a child process is freed at the end of a different request, the connection will then be serviced" (Ref. http://httpd.apache.org/docs/2.2/mod/mpm_common.html#maxclients).

If you look deeper in the related docs you will find how to manage also "serverlimit" and "maxrequestsperchild" according to the prefork/worker MPM, in order to avoid the situation pictured by Michael Hampton (very explanatory!).

Also, by checking logs you should find some evidences about this.

matteo
  • 226
  • 1
  • 6
  • I changed the conf for : maxclients: 10000, maxspareservers: 1000, minspareservers: 500, serverlimit: 10000, startservers: 3000, but I still have the same problem with 9,000 connected visitors, my website is superslow, and my CPU is only 30% used. – Pepito the intern Oct 13 '15 at 15:49
  • Any hint from the logs? (maybe by using debug mode) – matteo Oct 13 '15 at 21:14
  • I didn't find any log. I solve the problem by adding more server with Load Balancing. – Pepito the intern Oct 14 '15 at 12:19