Tweaking Apache

ju5t

Verified User
Joined
Sep 14, 2005
Messages
396
Location
Amsterdam
Just out of curiousity, what have you done to tweak apache? This is custom work for every server of course, but some things might always help.

We basically stuck onto the default configuration, but at times the load on apache is rather high even though connections are minimal.
 
We have 1.3.37 on all servers. Is it worth upgrading to the 2.x tree?

Do you expect any odd behavior if we do so? We do not run any custom modules or other modules incompatible with 2.x as far as I'm aware of.
 
in my server i am use same version like you.
try something like this:

Timeout 25
KeepAlive On
MaxKeepAliveRequests 25
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 25
StartServers 10
MaxClients 350
MaxRequestsPerChild 750

some info like number of webs and detail of your server will help to optimize httpd :)

and page like this http://root.co.il/status can be help :)
just find this line (ExtendedStatus Off) and change Off to On
 
We've done it as follows now:

Code:
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
MinSpareServers 5
MaxSpareServers 15
StartServers 10
MaxClients 350
MaxRequestsPerChild 100

This seems to be helping quite a lot. There are about 200 websites running on it. Server specs are XEON 3GHz and 1024MB memory. Quite a few websites are memory intensive, at least I think, can't say for sure because I'm not entirely sure how to monitor specific websites properly.
 
You should try to turn KeepAlive off, or leave KeepAliveTimeout something like 1. Also, you can try to increase Min/MaxSpareServers values.
 
Could you maybe explain the use of that? As in, how will this affect the server?
As how I understand it, turning off the KeepAlive directive will result in more childs spawning thus more connections/load? I'm probably wrong here though.
 
Whole books have been written on how to manage apache ;) .

But our experience has been that throwing memory at an overloaded server has always been rewarding :) .

Jeff
 
today I have upgraded from apache 2.0.59/php5.2.2/eaccelerator0.9.5.1patched to apache 2.2.6/php5.2.4/eaccelerator0.9.5.2
in my feeling box runs slower now.
How can I tweak apache 2.2?
Thanks in advance

BR

YacentY
 
I have big forum (on sunday there were 5.000visits and 3.500 unique visitors, 150000pageviews) it's running IPB and their gallery with average 150 users online and 250 in peak (20.00-22.00),
There are also few small forums with 3-5 users online and some blogs on WP.

here is my apache.conf:

Code:
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule mpm_prefork_module>
    StartServers         30
    MinSpareServers      10
    MaxSpareServers      30
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

my.cnf file

Code:
[mysqld]
default-character-set=latin2
init-connect = "SET NAMES latin2"
language=polish
skip-bdb
#skip-innodb
key_buffer = 192M
#16MB
myisam_sort_buffer_size = 34M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1528
thread_cache_size = 286
tmp_table_size = 64M
max_allowed_packet = 16M
query_cache_limit = 2M
query_cache_size = 256M
#64M
query_cache_type = 1
query_prealloc_size = 16384
query_alloc_block_size = 16384
tmpdir=/tmp
#myisam-recover


[mysqld_safe]
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 10M

[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

[client]
default-character-set=latin2

what can I and what should I exhange to get better performance?

the machine is: athlon a64 3700+, 2gb ram and sata hds
 
Back
Top