Jul 06
Boosting apache performance in high load environments.
I suggest decreasing timeout value and keepalivetimeout, as well as other values listed and described below.
Original timeout has been set to 300 by default. I suggest decreasing it to 120 (2 minutes) so all connections will timeout after 2 minutes. period.
Timeout 120
By default, keepalive is turned on for apache daemon. This is good, but there are some cases that it should be turned off as there is no gain. Usually this happens when you are serving medium to large files with a lot concurrent connections. Play around and see what works the best. Please pay attention to keepalive timeout as well (we will shortly post sysctl tweaks for network stack as well).
KeepAlive On
Maxkeepaliverequests is the maximum number of http requests over one persistent connection. If you are serving a lot of small files, increasing this value will boost overal performance. If the persistent connectivity is closed and browser requests a new request, a new connection will open, thus, slowing down overal performance a bit. This value however doesn’t apply if you have keepalive’s turned off.
MaxKeepAliveRequests 1000
Keepalivetimeout is the value in seconds to wait for the next request over the same connection for the same client. If you are serving a lot of small files, increasing this value will help. In another case, if you have thousands of concurrent connections, decreasing this value will boost the performance.
KeepAliveTimeout 15
For high load servers, please test KeepAliveTimeout with 2…5 seconds and see how does it affect you.
I hope this helps you. Enjoy
DC
Jul 06
If you need to configure your apache via .htaccess file (for example giving custom config overriding feature to non-root users on the system and not to affect/misconfigure other web sites, except their own) config .htaccess is a good solution to solve this problem.
By default, I suggest turning off override for root directory:
<Directory>
AllowOverride None
</Directory>
and only activating .htaccess file overring feature for required directory or web site:
<Directory /etc/webs/www.domain.com/public_html/>
AllowOverride All
</Directory>
In the above case, we allow AllowOverride All to /etc/webs/www.domain.com/public_html/ folder.
If we define/enable .htaccess to the exact dir we require it to be enabled, the web server will have better performance - no need to lookup every directory recursively to check if .htaccess support is enabled for the particular directory - thus, resulting in better performance and of course, security level is boosted as well.
Don’t forget that you can turn off .htaccess feature as defined above, and move all .htaccess configuration lines with proper syntax to http configuration file. This is the BEST way
Jul 05
Lightweight, secure, FAST… with full support for virtual hosting, on-the-fly output compression, large files, php, cgi, fast cgi, SSI, authentification (different types), code caches: turckmm, APC, eaccelerator and more. It’s lighttpd. We will devote a new blog section to this http daemon that will include a lot of configuration directives and manuals, tips/tricks in the future.
DC
Jul 04
Below, I have compiled a quick steps to make your Apache run faster and with better performance.
1.) When you are compiling turn off all the features and modules you do not need. The less the better.
2.) Turn off DNS logging with "HostnameLookups off" in httpd.conf file
3.) If you have .htaccess definitions, if possible, move it to httpd.conf file and turn off .htaccess lookup.
4.) If you prefer to use .htaccess, make sure you let the apache browser know that it should read it from the exact dir. For example, if you have /my/web/sites, configure httpd.conf to start looking for .htaccess only starting from /my/web/sites/ not just /my/ for example
5.) Tune MinSpareServers, MaxSpareServers, and StartServers
6.) If you are using mod_security always remember the more rules you have the less performance it is
Jul 03
Microsoft’s web server that runs on Windows server platforms and offers full Active Server Page, Microsoft Frontpage support. Starting from version 6.0 it also supports the Dynamic Systems Initiative (DSI) with process isolation and automated health monitoring.
A good server choise (actually totaly free if you have a Windows Server license) to run Windows based applications and services.
Web page: http://www.iis.net/
Jul 02
Hey folks… I was just thinking to launch a dedicated section for thttpd daemon and this is the first post in the thread that will include a lot of config and manuals about this tiny and super fast http daemon!
thttpd homepage: http://www.acme.com/software/thttpd/
so stay tuned. more GOOD stuff is coming shortly
Kev
Jul 01
Apache is a free and open source commercial grade web server software that according to Netcraft is the number
#1 server that is powering millions of web sites and growing.
Web site URL: http://www.apache.org
Ps. even this web site is hosted using Apache web server daemon!
Recent Comments