0

I have a web server with 16 GB of RAM. The server has a good traffic and have pics of 300 simultaneous requests.

Unfortunately when these peaks arrive queries fall into error or are very very slow.

When I look at the ram used on my server via the free command, it never exceeds 4-5 GB and the CPU load is on average 10%.

          total       used      free         shared   buffers   cached
Mem:      16392540    4820632   11571908     0        356120    1948920
-/+ buffers/cache:    2515592   13876948
Swap:     1049596     0         1049596

Here is my Apache 2 prefork configuration :

StartServers         32
MinSpareServers      32
MaxSpareServers      64
ServerLimit         512
MaxClients          512
MaxRequestsPerChild   0

Timeout 15
KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout 3

I would like to allow Apache to use more ram to handle all requests and not be overloaded. But even if I change the configuration, it does not seem to have any effect on memory usage.

I said that my server uses plesk.

I also use a MySQL database but containing only a table and a few records.

Do you have any idea?

Thanks for your help.
Martin

2

2 Answers 2

1

I also use a MySQL database but containing only a table and a few records.

If you are running a MySQL database it could be that your disk is the bottleneck.

Even with 'only a table and a few records' you can still have bad queries, long wait times, or some kind of issue with the database that is causing big delays, resulting in slowness.

The reason I say this, is because you have already identified that your Memory and CPU are not under too much stress.
The other thing to look at is whether or not you have the network throughput required for the amount of requests you are receiving.


As a final note, trust me when I say: tweaking Apache will be fruitless here. Look at your Database, Disk performance, and network bandwidth/throughput.

0

Vasili is quite right about hard drive and bottleneck in it. Also, if you're using Plesk 11 you can install nginx in front of apache. By default nginx not-configured and works in "promiscuous mode". Therefore you can simply configure and customize it according to your requirements thereby release apache from serving static files.

1
  • Apache is good at static file serving too, except that you need to take care that you don't have things like mod_php. I switched to apache 2.4 event MPM with mod_fastcgi for php. It works like a charm.
    – Nilesh
    Feb 8, 2014 at 9:59

Not the answer you're looking for? Browse other questions tagged .