May 102011
 

Ab / ApacheBench is a tool commonly used to perform benchmark by many people. unfortunately, the results are displayed somewhat difficult to read by most people. but it can be tricked by turning it into a plot image. this time, I will make examples how to change the results of apachebench into a form of image plots using gnuplot. although apachebench’s report is very helpful, we need to output the data in a parse-able format. To do this we use the -g switch which will output a gnuplot-friendly tab delimited table of data.

First we need to installed gnuplot if we don’t have it yet.

$sudo yum -y install gnuplot

In this example i’ll benchmark request on static png file.

Run first webserver benchmark

$ ab -k -n 50000 -c 100 -g server1.txt http://server1/server1.png

Run second webserver benchmark

$ ab -k -n 50000 -c 100 -g server2.txt http://server2/server2.png

Example result server1.txt/server2.txt

starttime       seconds ctime   dtime   ttime   wait
Tue May 10 16:42:28 2011        1305020548      0       2       2       2
Tue May 10 16:42:28 2011        1305020548      0       2       2       2
Tue May 10 16:42:28 2011        1305020548      0       3       3       2
Tue May 10 16:42:28 2011        1305020548      0       3       3       3
Tue May 10 16:42:28 2011        1305020548      0       3       3       3
Tue May 10 16:42:28 2011        1305020548      0       3       3       3
Tue May 10 16:42:28 2011        1305020548      0       3       3       3
Tue May 10 16:42:28 2011        1305020548      0       3       3       3

Continue reading »

Jul 022010
 

Displaying PDF In Our Website

Ingredients:

Download both software

# yum -y install swftools
# wget http://flexpaper.googlecode.com/files/FlexPaper_1.3.1_flash.zip

Go to http DocumentRoot, then unzip FlexPaper_1.3.1_flash.zip

# cd /var/www/html/
# unzip /path/to/FlexPaper_1.3.1_flash.zip

There’s example in FlexPaper_1.3.1_flash.zip distribution, We need to create our own swf file from existing pdf

# pdf2swf DNSSEC_in_6_minutes.pdf -o DNSSEC_in_6_minutes.swf -T 9 -f

Lots of NOTICE output there…

NOTICE  Adding /usr/share/swftools/fonts to font directories
Title:        Slide 1
Author:       Alan Clegg
Creator:      Impress
Producer:     OpenOffice.org 2.4
CreationDate: 20080715091448-04'00'
Pages:        79
Linearized:   no
Encrypted:    no
NOTICE  processing PDF page 1 (720x540:0:0) (move:0:0)
NOTICE  file contains jpeg pictures
NOTICE  file contains pbm pictures 
NOTICE  processing PDF page 2 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 3 (720x540:0:0) (move:0:0)
NOTICE  File contains links
NOTICE  processing PDF page 4 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 5 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 6 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 7 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 8 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 9 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 10 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 11 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 12 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 13 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 14 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 15 (720x540:0:0) (move:0:0)
NOTICE  processing PDF page 16 (720x540:0:0) (move:0:0)
--- cut ---
NOTICE  SWF written

Continue reading »