Web Server Performance Analysis PDF
Web Server Performance Analysis PDF
Abstract—Web servers become more and more important for company’s which core business is done on the internet.
Several web server software is available and is used. In this report a comparison is made between the Apache 2.4.1
web server and the Nginx 1.0.12 web server. During the tests with static and dynamic files the differences between both
can be seen. Nginx performed very good using static files, while Apache performed much better using dynamic files. So
for every specific task is a web server available.
TABLE 3
Image File
TABLE 2
HTML-File Nginx
Fig. 6. Results of the image test
5.1.2 Image-file
5.2 Dynamic file
The image file has a file size of 56858 bytes,
applying the formula from chapter 3 one get 5.2.1 Hello World
the following result: The result of the hello worki-file has a file size
of 11 bytes, applying the formula from 3 one
941 M bps ∗ 106 bit/1s
2.068 hits/s = 56858 bytes ∗ 8 bits/ 1 byte get the following result:
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 5
TABLE 4
Image File-Nginx
A PPENDIX A
A PACHE C ONFIG
A.1 httpd.conf
ServerRoot "/usr/local/apache2"
Listen 80
<IfModule unixd_module>
User daemon
Group daemon
</IfModule>
<Directory />
AllowOverride none
Require all denied
</Directory>
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 7
DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/usr/local/apache2/htdocs">
AllowOverride None
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"
%I %O" combinedio
</IfModule>
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
</IfModule>
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 8
TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
</IfModule>
# Supplemental configuration
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 9
A PPENDIX B
N GINX C ONFIG
B.1 nginx.conf
user nginx;
worker_processes 4;
worker_rlimit_nofile 65535;
events {
# worker_connections 1024;
worker_connections 16384;
use epoll;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
keepalive_timeout 90;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}
B.2 default.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 10
location / {
root /usr/share/nginx/html;
index index.html index.htm index.php;
}
A PPENDIX C
S ERVER CONFIG
fs.file-max = 5000000
net.core.netdev_max_backlog = 400000
net.core.optmem_max = 10000000
net.core.rmem_default = 10000000
net.core.rmem_max = 10000000
net.core.somaxconn = 100000
net.core.wmem_default = 10000000
net.core.wmem_max = 10000000
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_congestion_control = bic
net.ipv4.tcp_ecn = 0
net.ipv4.tcp_max_syn_backlog = 12000
net.ipv4.tcp_max_tw_buckets = 2000000
net.ipv4.tcp_mem = 30000000 30000000 30000000
net.ipv4.tcp_rmem = 30000000 30000000 30000000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_wmem = 30000000 30000000 30000000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 12
A PPENDIX D
AB SCRIPT
#!/bin/bash
do
for j in 1 10 100 250 500
do
echo "ab -n $i -c $j -k http://145.100.104.16/index.html"
ab -n $i -c $j http://145.100.104.16/index.html >>
apache/index-$j-$i.txt
done
done
do
for b in 1 10 100 250 500
do
echo "ab -n $a -c $b -k http://145.100.104.16/uitzicht.JPG"
ab -n $a -c $b http://145.100.104.16/uitzicht.JPG >>
apache/uitzicht-$b-$a.txt
done
done
do
for d in 1 10 100 250 500
do
echo "ab -n $c -c $d -k http://145.100.104.16/hello.php"
ab -n $c -c $d http://145.100.104.16/hello.php >> nignx2/hello-$d-$c.txt
done
done
do
for f in 1 10 100 250 500
do
echo "ab -n $e -c $f -k http://145.100.104.16/index.php"
ab -n $e -c $f http://145.100.104.16/index.php >> apache/indexphp-$f-$e.txt
done
done
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 13
A PPENDIX E
T EST FILES
E.1 index.html
<html>
<head>
<title>Server X
</head>
<body>
<h1>Server X
</body>
</html>
E.2 uizicht.JPG
E.3 index.php
<?php
phpinfo();
?>
E.4 hello.php
<?php
echo "Hello World";
?>
WEB SERVER PERFORMANCE ANALYSIS, LIA PROJECT, 2ND APRIL 2010 14
R EFERENCES
[1] ab - apache http server benchmarking tool. Website. available at http://httpd.apache.org/docs/2.0/programs/ab.html; on
01st April 2012.
[2] Apache httpd. Website. available at http://httpd.apache.org/; on 01st April 2012.
[3] Apache httpd 2.4.1. Website. available at http://www.apache.org/dist/httpd/Announcement2.4.html; on 01st April 2012.
[4] Event mpm. Website. available at http://httpd.apache.org/docs/2.4/en/mod/event.html; on 01st April 2012.
[5] Iperf. Website. available at http://iperf.sourceforge.net/; on 01st April 2012.
[6] Linux Kernel. Linux IP Sysctl Documentation. available at http://www.kernel.org/doc/Documentation/networking/ip-sysctl.
txt; on 01st April 2012.
[7] Netcraft. Website. available at http://news.netcraft.com/; on 01st April 2012.
[8] Php. Website. available at http://www.php.net/; on 01st April 2012.
[9] Prefork mpm. Website. available at http://httpd.apache.org/docs/2.4/en/mod/prefork.html; on 01st April 2012.
[10] Worker mpm. Website. available at http://httpd.apache.org/docs/2.4/en/mod/worker.html; on 01st April 2012.
[11] Worker processes. Website. available at http://nginx.org/en/docs/ngx\ core\ module.html\#worker\ processes; on 01st
April 2012.
[12] Nginx. Website. available at http://nginx.org/; on 01st April 2012.
[13] Bryan Veal and Annie Foong. Performance Scalability of a Multi-Core Web Server, November 2007.