D
D
DenisO2010-12-14 22:18:13
Apache HTTP Server
DenisO, 2010-12-14 22:18:13

Optimal apache setup?

Good time of the day.

There is Apache with the following config:

<IfModule prefork.c>
StartServers 2
MinSpareServers 2
MaxSpareServers 5
ServerLimit 32
MaxClients 32
MaxRequestsPerChild 400


<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75 ThreadsPerChild
25 MaxRequestsPerChild
0 CPU 1024 Mb RAM top shows: top - 22:16:38 up 1:30, 1 user, load average: 1.72, 1.60, 1.44 Tasks: 54 total, 3 running, 51 sleeping, 0 stopped, 0 zombie



Cpu(s): 6.7%us, 3.0%sy, 0.0%ni, 0.0%id, 84.3%wa, 0.0%hi, 0.0%si, 6.0
%
st : 131064k total, 0k used, 131064k free, 219164k cached

Apparently Apache does not use the server to its full potential.

Hence the questions:
1. How to determine which Apache I have - worker or prefork?
2. What parameters should be scored?

Thank you very much in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2010-12-14
@bondbig

1. How can I determine which Apache I have - worker or prefork?
What OS? On Linux, you need to look in /etc/sysconfig/, there is a config there. In general, you can look like this:
ps aux | grep http
If there is no word 'worker', then 'prefork'. Surely prefork, it is by default, as it is more stable in most cases.
2. What parameters should be scored?
And here it is necessary to approach the problem empirically. If there is nothing on the server other than Apache, then look at the average size of one of your Apache processes and set
($amount_of_ram - minus a little / $apache_proccess_size) so that when all Apache processes are active, the memory in the system does not run out. If other services are dangling, hungry for memory, then subtract from $amount_of_ram what is allocated for them.
In general, do not forget to set a reverse proxy (I recommend nginx) in front of Apache, it’s not comme il faut to put it on the Internet, it’s very easy to eat all its processes by sending a lot of “slow” connections.

G
gro, 2010-12-14
@gro

The optimal Apache setup is to replace it with something, for example, nginx )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question