Wednesday, 19 November 2014

Optimize WebServer Performance

Optimize WebServer Performance

WebServer performance can be improved by compressing static web files and reducing the network chattiness between webserver and client system.

_Below are the configuration steps for IHS webserver to enable web compression (to compress web static files) and content caching (to cache static files at client system and reduce network chattiness between webserver and client system)

####Files affected: httpd.conf##############################

Enable required libraries by uncommenting or adding lines to httpd.conf
LoadModule headers_module modules/mod_headers.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule expires_module modules/mod_expires.so

_Enable Web Compression (for files with MIME type: text/html text/plain text/xml text/css text/javascript application/x-javascript)
################################## WEB COMPRESSION START *********************************
SetOutputFilter DEFLATE
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.[0678] no-gzip
BrowserMatch \bMSIE\s(7|8) !no-gzip !gzip-only-text/html
BrowserMatch \bOpera !no-gzip
Header append Vary User-Agent
################################## WEB COMPRESSION END **********************************
*Note: Compression will be skipped if client uses Mozilla versions 4.0 or 4.6 or 4.7 or 4.8 and IE versions 6 or 9 or 10 as their browser

Enable Content Caching (for files with MIME type: text/javascript application/x-javascript text/css text/html image/png image/gif image/jpeg and files with extentions: gif jpeg jpg png ico css js html htm)
################################## Content Caching START **************************************
<IfModule mod_expires.c>
AllowEncodedSlashes On
ExpiresActive On
ExpiresByType text/javascript "access plus 24 hours"
ExpiresByType application/x-javascript "access plus 24 hours"
ExpiresByType text/css "access plus 24 hours"
ExpiresByType text/html "access plus 24 hours"
ExpiresByType image/png "access plus 24 hours"
ExpiresByType image/gif "access plus 24 hours"
ExpiresByType image/jpeg "access plus 24 hours"
<LocationMatch "\.(gif|jpeg|jpg|png|ico|css|js|html|htm)$">
Header set Cache-Control "public, max-age=86400"
</LocationMatch>
</IfModule>
################################## Content Caching END ****************************************
Restart WebServer

            

No comments:

Post a Comment

Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "Failed to create a thread: retVal -1073741830, errno 11" received

1. Output of the following commands (non root): ulimit -u ulimit -a df -k 2. From any of the JVM that is running, please get it's...