27

Digital Poets Society: Symfony2 Load Testing

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Digital Poets Society: Symfony2 Load Testing
Page 2: Digital Poets Society: Symfony2 Load Testing

Load Testing

Page 3: Digital Poets Society: Symfony2 Load Testing

Load Testing

Page 4: Digital Poets Society: Symfony2 Load Testing

Me

David GilbertHosting Manager @ August

[email protected]

Page 5: Digital Poets Society: Symfony2 Load Testing

Me

Ops not Dev

Page 6: Digital Poets Society: Symfony2 Load Testing
Page 7: Digital Poets Society: Symfony2 Load Testing

What’s this got to do with Symfony2?

“On the other hand, Symfony2 was

conceived from the start to be fast, with a

strong emphasis on performance.”- The technological benefits of Symfony in 6 easy lessons

http://symfony.com/six-technical-reasons

Page 8: Digital Poets Society: Symfony2 Load Testing

Warning! Contains nuts

Your mileage may WILL vary

Page 9: Digital Poets Society: Symfony2 Load Testing

What is Load Testing?“Load testing is a simulation of multiple users working with a web application at

the same time.”

“It can be performed for a number of purposes, but the main goal is to check

the performance of the application.”

Page 10: Digital Poets Society: Symfony2 Load Testing

Types of Load Testing

Performance Testing

Capacity Testing

Stress Testing

Volume Testing

Endurance Testing

Regression Testing

Page 11: Digital Poets Society: Symfony2 Load Testing

Types of Load Testing

Performance Testing

Capacity Testing

Stress Testing

Volume Testing

Endurance Testing

Regression Testing

Page 12: Digital Poets Society: Symfony2 Load Testing

Load Testing Tools

Page 13: Digital Poets Society: Symfony2 Load Testing

Apache JMeter

Page 14: Digital Poets Society: Symfony2 Load Testing

HP LoadRunner

Page 15: Digital Poets Society: Symfony2 Load Testing

Load Impact

Page 16: Digital Poets Society: Symfony2 Load Testing

Siege

http://www.joedog.org/siege-home/

Page 17: Digital Poets Society: Symfony2 Load Testing

Assumed Infrastructure

Page 18: Digital Poets Society: Symfony2 Load Testing

Preparing for battle - ~/.siegercCreate an initial configuration

$ siege.configCustomise

csv = trueshow-logfile = false

benchmark = true

Page 19: Digital Poets Society: Symfony2 Load Testing

But the pages I need to test are password protected!http basic authentication

login =Cookie based authentication

login-url =

Page 20: Digital Poets Society: Symfony2 Load Testing

Specifying pages to testTwo ways:

On the command line$ siege http://www.example.com/

Using a file of URLsfile =

Page 21: Digital Poets Society: Symfony2 Load Testing

Laying siegeDon’t do this:

$ siege -c 200 -t 10m

Start simple$ siege -c 1 -t 30s

Save the individual test timings$ siege -c 1 -t 30s > siege.csv

Page 22: Digital Poets Society: Symfony2 Load Testing

Interpreting Results - Summary

Page 23: Digital Poets Society: Symfony2 Load Testing

Interpreting Results

Page 24: Digital Poets Society: Symfony2 Load Testing

Pitfalls· Don’t load test your load testing host

· Know the capacity of the network between your load test host and the load test target

· Monitor the load test target and check for contention when testing

Page 25: Digital Poets Society: Symfony2 Load Testing

iptables Connection Tracking$ sysctl net.netfilter.nf_conntrack_maxnet.netfilter.nf_conntrack_max = 31884

$ sudo tail -f /var/log/messagesJun 4 22:14:27 noc kernel: nf_conntrack: table full, dropping packet.

$ sudo sysctl -w net.netfilter.nf_conntrack_max=49152net.netfilter.nf_conntrack_max = 49152

Page 26: Digital Poets Society: Symfony2 Load Testing

TCP TIME_WAIT state$ sysctl net.ipv4.ip_local_port_rangenet.ipv4.ip_local_port_range = 32768 61000

=> 28,233 usable ports$ sudo sysctl -w net.ipv4.ip_local_port_range=’1024

65535’net.ipv4.ip_local_port_range = 1024 65535

Page 27: Digital Poets Society: Symfony2 Load Testing

Beat those Web Apps!