Optimal configuration of Apache?

0 like 0 dislike
46 views
Good time of day.


Have Apache with the following config:




StartServers 2

MinSpareServers 2

MaxSpareServers 5

ServerLimit 32

MaxClients 32

MaxRequestsPerChild 400





StartServers 2

MaxClients 150

MinSpareThreads 25

MaxSpareThreads 75

ThreadsPerChild 25

MaxRequestsPerChild 0



And VPS with the following characteristics:

1280 MHz 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

Mem: total 1047728k, 421872k used 625856k free, 57108k buffers

Swap: 131064k total, 0k used, 131064k free, 219164k cached


Apparently Apache does not use the full capabilities of the server.


Hence the questions:

1. How to determine what my Apache — prefork or worker?

2. What settings should score?


Thanks in advance.
by | 46 views

4 Answers

0 like 0 dislike
1. How to determine what my Apache — prefork or worker?
What OS? In Linux in /etc/sysconfig/ need to see the config there is. Universal so you can look:
\r
ps aux | grep http 
If the word 'worker' not, 'prefork'. Probably prefork, it is the default, as is more stable in most cases.
\r
2. What settings should score?
And here is a need to empirically approach the problem. If the server in addition to Apache, there is nothing, look at the average size of your Apache process and set
($amount_of_ram — minus/$apache_proccess_size) so that when all the processes Apache will be active don't run out of memory in the system. If hanging out the other services a lot of memory, from $amount_of_ram proofread what they allocated.
\r
And do not forget to put a reverse proxy (I recommend nginx) in front of the Apache, his pantsless Internet to put not comme Il faut, it's very easy to eat all his processes by a promise of many slow connections.
by
0 like 0 dislike
Optimal configuration of Apache is to replace it with something, for example, nginx )
by
0 like 0 dislike
Don't you see: 84.3%wa
The host nachinaetsya hard, too many iops You have.
the solution — put eaccelerator, put a frontend nginx with caching, increase caches mysql, use the internal caching mechanisms of the project (for example wp super cache)
by
0 like 0 dislike
tuning apache just will not help, you need to optimize or, go to RAM
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
4 answers
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
28,888 users