httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Thyssen" <>
Subject [users@httpd] performance and mod_deflate optimization
Date Sun, 01 Jul 2007 18:17:52 GMT

I'm trying to optimize speed by using mod_deflate
on a particular personal server. It runs Apache
httpd 2.052+ and PHP Version 5.1.6, with eaccellerator,
on Linux 2.6.9-023stab033.6 SMP kernel for CentOS 4.5.

Roughly, it serves 5 websites, combined they get
about 1 real human visit each second in total
(excluding redirected hits, blocked spammers/IPs/robots/spiders).
One of the sites is behind SSL, for squirrelmail webmail.
Most filetypes it serves are php (flatfile non-mysql weblogs),
a few text and .htm* files, a very small cgi-script here and there
(and a couple of imagefiles, avi's and mp3's, but not very much).
Bandwidth/traffic are no problem factors for this server, it runs
with a 100 mbit NIC to the net, and I can use it wide-open.
Currently it uses about 210 MB of DDR3, and I have at least
another 128 MB of RAM left, and CPU also has room to do more.

>From the current httpd.conf :

# added gzip for mod_deflate:
#<Location />
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI
\.(?:gif|jpe?g|png|wav|mp3|ogg|bmp|avi|mpg)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
DeflateCompressionLevel 5
DeflateMemLevel 9
DeflateWindowSize 14
#AddOutputFilterByType DEFLATE text/html text/plain text/xml

(When I uncomment the Location tags, Apache won't start.
Haven't figured out why, but doesn't seem to matter,
since I'm running it for all the sites anyway.)

This httpd.conf has had a pretty long life, so I forgot
much of what I've changed over the years. But I was
wondering how I could better load speeds for php webpages
using mod_deflate, and also, handy pointers on how to best
measure this perhaps, although I don't have very much
time to spend on that. I just wonder if any of you
sees really strange or bad general config values.

For that I'm posting some other more or less
crucial values from the same conf:

Timeout 120
KeepAlive On
MaxKeepAliveRequests 60
KeepAliveTimeout 22
# SendBufferSize 16384

<IfModule prefork.c>
StartServers       8
MinSpareServers    4
MaxSpareServers   16
ServerLimit      256
MaxClients       256
MaxRequestsPerChild  800

<IfModule worker.c>
StartServers         4
MaxClients         128
MinSpareThreads     16
MaxSpareThreads     70
ThreadsPerChild     24
MaxRequestsPerChild  800

LoadModule access_module modules/
LoadModule auth_module modules/
LoadModule auth_anon_module modules/
LoadModule auth_dbm_module modules/
LoadModule auth_digest_module modules/
LoadModule ldap_module modules/
#LoadModule auth_ldap_module modules/
#LoadModule include_module modules/
LoadModule log_config_module modules/
LoadModule env_module modules/
LoadModule mime_magic_module modules/
#LoadModule cern_meta_module modules/
LoadModule expires_module modules/
LoadModule deflate_module modules/
LoadModule headers_module modules/
#LoadModule usertrack_module modules/
LoadModule setenvif_module modules/
LoadModule mime_module modules/
#LoadModule dav_module modules/
#LoadModule status_module modules/
LoadModule autoindex_module modules/
LoadModule asis_module modules/
#LoadModule info_module modules/
#LoadModule dav_fs_module modules/
LoadModule vhost_alias_module modules/
LoadModule negotiation_module modules/
LoadModule dir_module modules/
LoadModule imap_module modules/
LoadModule actions_module modules/
LoadModule speling_module modules/
CheckSpelling on
#LoadModule userdir_module modules/
LoadModule alias_module modules/
LoadModule rewrite_module modules/
LoadModule cache_module modules/
LoadModule suexec_module modules/
LoadModule disk_cache_module modules/
LoadModule file_cache_module modules/
LoadModule mem_cache_module modules/
LoadModule cgi_module modules/
# added april 2007:
LoadFile /usr/lib/
LoadModule unique_id_module modules/
LoadModule security2_module modules/
#LoadModule evasive20_module modules/

Those last ones I'm still experimenting with.
For now I use mod_security with only very basic defaults.
This server doesn't really suffer from DDoS attacks often.

Any advice or improvements highly appreciated.



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message