Home / Blog

ab

ab is a tool for benchmarking your Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.

Gnuplot

Gnuplot is a free, command-driven, interactive, function and data plotting program.

Benchmark

We run ab2 against my site, http://lotto-kim.net with 1000 requests and 100 concurrent connections and store the request time with -g.

kim@lotta:~> ab2 -g http_benchmark.txt -n 1000 -c 100 http://lotto-kim.net/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking interira.no.ezpublish10.ezdeal.no (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        Apache/2.2.3
Server Hostname:        lotto-kim.net
Server Port:            80

Document Path:          /
Document Length:        11313 bytes

Concurrency Level:      100
Time taken for tests:   27.395710 seconds
Complete requests:      1000
Failed requests:        9
   (Connect: 0, Length: 9, Exceptions: 0)
Write errors:           0
Total transferred:      11725880 bytes
HTML transferred:       11271195 bytes
Requests per second:    36.50 [#/sec] (mean)
Time per request:       2739.571 [ms] (mean)
Time per request:       27.396 [ms] (mean, across all concurrent requests)
Transfer rate:          417.99 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   62 152.5      0    1047
Processing:   228 2652 859.6   2751    6719
Waiting:      191 1966 764.0   2006    5679
Total:        229 2715 851.5   2780    6719

Percentage of the requests served within a certain time (ms)
  50%   2780
  66%   3030
  75%   3210
  80%   3312
  90%   3697
  95%   4023
  98%   4318
  99%   4660
 100%   6719 (longest request)

Results

kim@lotta:~> gnuplot
set terminal png
set output "http_benchmark.png"
set xlabel "request"
set ylabel "ms"
plot "http_benchmark.txt" using 7 with lines title "ctime", \
 "http_benchmark.txt" using 8 with lines title "dtime", \
 "http_benchmark.txt" using 9 with lines title "ttime", \
"http_benchmark.txt" using 10 with lines title "wait"

Here is the result of the benchmark plotted into a graph.

eZ Publish 4.0.0rc1 was released today with a numerous bug fixes and code enhancements over the previous alpha2 release. Highlights include performance optimisations.

What have really been done to optimize the performance of eZ Publish? I have done a benchmark of eZ Publish 4 alpha2 vs eZ Publish 4 rc1 and PHP 5.1.2 vs PHP 5.2.5, here is the results:

Test environment

Hardware

IBM HS21
2x quad core
8GB Memory

Software

Suse Linux Enterprise Server 10 SP1 64bit
Apache 2.2.3
APC 3.0.15
MySQL 5.0.26

PHP 5.1.2 / PHP 5.2.5

The benchmark

ab2 -n 1000 -c 20 http://site.no/

The results

eZ Publish 4.0.0-alpha2 - PHP 5.1.2

Concurrency Level: 20
Time taken for tests: 11.157765 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 18968000 bytes
HTML transferred: 18534000 bytes
Requests per second: 89.62 [#/sec] (mean)
Time per request: 223.155 [ms] (mean)
Time per request: 11.158 [ms] (mean, across all concurrent requests)
Transfer rate: 1660.10 [Kbytes/sec] received

eZ Publish 4.0.0rc1 - PHP 5.1.2

Concurrency Level: 20
Time taken for tests: 9.19638 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 20958000 bytes
HTML transferred: 20524000 bytes
Requests per second: 110.87 [#/sec] (mean)
Time per request: 180.393 [ms] (mean)
Time per request: 9.020 [ms] (mean, across all concurrent requests)
Transfer rate: 2269.05 [Kbytes/sec] received

eZ Publish 4.0.0rc1 - PHP 5.2.5

Concurrency Level: 20
Time taken for tests: 27.289963 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 20958000 bytes
HTML transferred: 20524000 bytes
Requests per second: 36.64 [#/sec] (mean)
Time per request: 545.799 [ms] (mean)
Time per request: 27.290 [ms] (mean, across all concurrent requests)
Transfer rate: 749.95 [Kbytes/sec] received

eZ Publish 4.0.0alpha2 - PHP 5.2.5

Concurrency Level: 20
Time taken for tests: 28.472612 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 18968000 bytes
HTML transferred: 18534000 bytes
Requests per second: 35.12 [#/sec] (mean)
Time per request: 569.452 [ms] (mean)
Time per request: 28.473 [ms] (mean, across all concurrent requests)
Transfer rate: 650.55 [Kbytes/sec] received

I can't understand why PHP 5.1.2 is much faster then PHP 5.2.5? Is there something wrong with my environment?

UPDATE:

eZ Publish 4.0.0 - PHP 5.1.6

Concurrency Level: 20
Time taken for tests: 13.552577 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 21607000 bytes
HTML transferred: 21173000 bytes
Requests per second: 73.79 [#/sec] (mean)
Time per request: 271.052 [ms] (mean)
Time per request: 13.553 [ms] (mean, across all concurrent requests)
Transfer rate: 1556.90 [Kbytes/sec] received

eZ Publish 4.0.0 - PHP 5.2.0

Concurrency Level: 20
Time taken for tests: 13.168876 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 21671773 bytes
HTML transferred: 21236471 bytes
Requests per second: 75.94 [#/sec] (mean)
Time per request: 263.378 [ms] (mean)
Time per request: 13.169 [ms] (mean, across all concurrent requests)
Transfer rate: 1607.05 [Kbytes/sec] received

gdb httpd2-prefork

b ap_process_request

run -X -d /usr/sbin/httpd2-prefork

s

Installation

lotta:~ # svn co http://svn.apache.org/repos/asf/httpd/test/trunk/flood
lotta:~ # cd flood
lotta:~/flood # svn co http://svn.apache.org/repos/asf/apr/apr/trunk apr
lotta:~/flood # svn co http://svn.apache.org/repos/asf/apr/apr-util/trunk apr-util
lotta:~/flood # ./buildconf
lotto:~/flood # ./configure --disable-shared --prefix=/opt/flood
lotta:~/flood # make
lotta:~/flood # make install

To find and replace one or more occurences of a given text pattern with a new text string, use the s[ubstitute] command.

First we need to do is to open the file we want to do the "search and replace"

qkim@lotta:~> vim file.txt

This is the content of file.txt. Lets change some of it with search and replace.
This is a test, a test this is. Just a lots of tests. I want to change test with beer.

:%s/test/beer/g
4 substitutions on 1 line
:wq

qkim@lotta:~> cat file.txt
This is the content of file.txt. Lets change some of it with search and replace.
This is a beer, a beer this is. Just a lots of beers. I want to change beer with beer.

Gnuplot is a free, command-driven, interactive, function and data plotting program.

Lets create a graph using Gnuplot based on data we got in a table. You can download the table I'm using here.

qkim@lotta:~> gnuplot

gnuplot> plot  "gnuplot_table.txt" using 1:2 title 'data1' w linespoints, \
"gnuplot_table.txt" using 1:3 title 'data2' w linespoints

Gnuplot does not need so complicated when creating simple graphs.


Screenshot of Gnuplot

I was playing around with a A12E-G2121-2 to set up iscsi when I discovered a Configuration List at the bottom of the RAIDWatch Manager application. It was possible to right-click on this list and select export- and import-XML. When logged in as the Information user, you still have the opportunity to right click and select export- or import-XML. And of course, this is something I needed to try. It was possible to export a configuration, change the XML, and import it again without having access to the configuration section.

WebDAV is an abbreviation for "Web-based Distributed Authoring and Versioning" (published as an open standard under RFC 2518). WebDAV is a set of extensions to the HTTP protocol which allows users to collaboratively edit and manage files on a web server. Using a WebDAV compatible client, the user connects to the server and is able to browse and manage files in a similar way as with a network share or an FTP server. In other words, what this protocol does is that it makes it possible to browse, create, remove, upload, download, rename, etc. files and directories on a web server. One of the most important advantages of this technology is that it uses port 80 for network traffic. This means that if you are able to surf the site from your workstation, you can also use WebDAV to administer it.

Configuration

The first you need to do is to set up a virtualhost for your webserver.

Apache HTTPD

<VirtualHost 89.250.126.18>
ServerName webdav.lotto-kim.net
        <Directory /home/sites/lotto-kim.net/www>
                Options indexes FollowSymLinks
                AllowOverride None
                Order allow,deny
                Allow from All
        </Directory>
        DocumentRoot /home/sites/lotto-kim.net/www
        RewriteEngine On
        RewriteRule !\.(css|jar|js|html|php)$ 
/home/sites/lotto-kim.net/www/webdav.php
        CustomLog "|/usr/sbin/rotatelogs2
 /var/log/sites/www.lotto-kim.net/www 3600" combined
        ErrorLog "/var/log/sites/www.lotto-kim.net/error_log
        RewriteLog /var/log/sites/www.lotto-kim.net/rewrite_log
        RewriteLogLevel 0
        <Location />
                php_admin_value upload_tmp_dir /home/sites/lotto-kim.net/tmp
                php_admin_value open_basedir /home/sites/lotto-kim.net:
/usr/local/bin:/usr/local/imagemagick/bin:
        </Location>
</VirtualHost>

Lighttpd

$HTTP["host"] == "webdav.lotto-kim.net" {
 var.server_name = "webdav.lotto-kim.net"
 server.name = server_name
 server.document-root = server_root + "lotto-kim.net/www"
 accesslog.filename          = "/var/log/sites/lotto-kim.net/www"
 url.rewrite-once = ("^/.*$" => "/webdav.php")
}

Enable WebDav in eZ Publish

WebDav is disabled in eZ Publish as default, so we need to be enable it to get it working.

# echo -e "[GeneralSettings]\nEnableWebDAV=true\n" >> webdav.ini.append.php

Testing

I'm using cadaver to check if webdav is working on my domain, you can of course use other clients as well.

# cadaver webdav.lotto-kim.net
dav:/> ls site
Listing collection `/site/': Authentication required for eZ publish WebDAV
 interface on server `webdav.lotto-kim.net':
Username: admin
Password:
Retrying: succeeded.
Coll:   Content                                0  Aug 23 21:11
Coll:   Media                                  0  Aug 23 21:11
dav:/> ls
Listing collection `/': succeeded.
Coll:   eng                                    0  Aug 23 21:11
Coll:   site                                   0  Aug 23 21:11
Coll:   siteadmin                              0  Aug 23 21:11
dav:/> cd site
dav:/site/> ls
Listing collection `/site/': succeeded.
Coll:   Content                                0  Aug 23 21:11
Coll:   Media                                  0  Aug 23 21:11
dav:/site/> cd Content
dav:/site/Content/> ls
Listing collection `/site/Content/': succeeded.
Coll:   Blog                                   0  Aug 23 21:47
Coll:   Contact                                0  Aug 27 23:05
Coll:   Photos                                 0  Aug 27 23:06
Coll:   Projects                               0  Aug 27 23:07

New site is up and running, it will properly be a temporary project and will be dead within some few days

Skleed refers us to the NYTimes for an article on the high-stakes case the US is losing before the World Trade Organization. So far the US has lost an initial hearing and two appeals on its policies regarding Antiguan offshore gambling sites. Now the lawyer pressing the case has asked for a rarely invoked, but codified, recourse under WTO rules: letting Antiguans copy and distribute American music, movies, and software. The game may be to get Hollywood and Microsoft, et al., to pressure Washington to cut a deal. But their influence may not be sufficient to move lawmakers on the question of online gambling.

my blog

Mon Tue Wed Thu Fri Sat Sun
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30