How to create a load testing
environment for your web apps using
open source tools
Open source load testing for web
putting demand on an application and
measuring its response
see how application acts when you have
several concurrent users logging in
difference between "regression testing tools"
and "load testing"
goal - to define the maximum amount of load a
What do we test for?
how does my application act when I have more
than a single user logged in?
what hardware configuration does my
application need?
how does my application scale with more and
more concurrent users?
how much load can my application handle?
up to what point is my application useable with
a growing load?
what is the right web/app and database server
What do we test?
the application
the front end servers with different hardware
and software configurations
How do we test?
Application:
log in
run search
add item to cart check out
Front-end servers:
create a simple page and hit it with different loads change configuration and run tests again
Database servers:
transactional read/write benchmarks
What tools can we use?
Web Server/Application: apache bench siege httperf Jmeter Database: sysbench iibenchMonitoring and creating graphs
monitor the performance of our servers
use test monitoring data to build graphs for
easy comparison
use dstat to gather monitoring information
use gnuplot to plot graphs
or use orca to get monitoring and graphing all in
Let's get our hands dirty
setup the applications required for simulating a
load on the web server
setup monitoring tool - dstat
run tests and restart web server after each test
Web server load testing with
Apache bench
get apache bench
write a simple web application that will read
some data from the DB and display
run a test such as "# ab -n 100 -c 10
http://localhost/benchmark.php"
this will create 10 concurrent threads and a
total of 1000 requests
How do we use siege for our load
test?
get siege from ftp://ftp.joedog.org/pub/siege/
"siege -c25 -t1M http://localhost/bookmark.php"
- 25 concurrent users for 1 minute
great thing about it is that you can use the
POST feature with this tool
How do we use httperf?
get from http://httperf.sf.net
one the most advanced command line load
testing tool
"# httperf --server localhost --uri
/benchmark.php --num-conn 1000 --num-call 10 --rate 200 --timeout 5"
How do we monitor the
performance of our servers?
get dstat from
http://dag.wieers.com/home-made/dstat/
simple, great, flexible, all info you need, with
csv output file...
"# dstat --output benchmark.csv -tcmn 10" -
read time, cpu, memory, and network every 10 seconds and write to file
How do we run the actual tests?
localhost vs remote server
leave gap between tests
restart server
start monitoring before you fire the load building
How we test the database server
with sysbench?
general database performance evaluation tool
helps you evaluate your OS's parameters for
database server without installing DB
get from http://sysbench.sourceforge.net
"# sysbench --num-threads=16
--max-requests=100000 --test=oltp --oltp-table-size=1000000 \
How to use iibench to test the
database server?
iibench does a raw INSERT testing of your
database
get from http://tokutek.com/contest.php
great for web application where you expect a lot
How do we run the actual load
testing for our database servers?
run tests with default configuration
modify database server configuration and run
tests again
restart database server after each test
try with different hardware configurations
What do we do with all this
performance monitoring data?
we plot graphs
use a spreadsheet application
gnuplot is very advanced, flexible, and can read
from csv files
How do we get monitoring and
graphs all in one package?
get orca from
http://www.orcaware.com/orca/pub/snapshots/
lots of perl prerequisites
runs on the web server, so easy to access
remotely
What next?
automate the testing by scripting
fine tune and improve test framework
limitations of this type of testing
browsermob
About me
Sukrit from Pondicherry, India
open source enthusiast
help organizations adopt open source tools