10. Benchmarking 127.0.0.1 (be patient).....done
Server Software: Apache/2.2.22
Server Hostname: 127.0.0.1
Server Port: 8080
Document Path: /bugzilla/buglist.cgi
Document Length: 14562 bytes
Concurrency Level: 1
Time taken for tests: 33.816 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 1494100 bytes
HTML transferred: 1456200 bytes
Requests per second: 2.96 [#/sec] (mean)
Time per request: 338.163 [ms] (mean)
Time per request: 338.163 [ms] (mean, across all concurrent
requests)
Transfer rate: 43.15 [Kbytes/sec] received
11. Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 313 338 20.7 333 448
Waiting: 312 337 20.6 332 448
Total: 313 338 20.7 333 448
Percentage of the requests served within a certain time (ms)
50% 333
66% 339
75% 343
80% 345
90% 357
95% 374
98% 430
99% 448
100% 448 (longest request)
18. Profile to find out where the
time is going
● Devel::NYTProf
● Wall clock time vs. CPU time
● Use your real environment
● Multiple runs and warmup avoid
skewed results
● Let's look at one...
20. Sure, every now and then you
find
● A bad regex
● A string being parsed over and over
● Massive object instantiation
● Network operations
● Disk reads
21. But mostly it's the database
● What’s slow in modern computers?
● What does most of the I/O in a typical
web app?
● Either fix your queries or cache them
23. Speeding up queries
● EXPLAIN plans
○ pt-query-advisor
● SQL generation is not for everything
● A little bit of database server tuning
○ pt-variable-advisor
24. Speeding up DBI
● Cache connections and statements
● Manage commits
● Use native bulk loading tools
25. The last resort: caching
● Cache management is a hard problem
● Code complexity
○ invalidation calls
○ dependency tracking
● Your content creators will hate it
● When you do cache, use CHI
26. A brief word about runtime
environments
● Webserver choice has a minimal effect
on performance
● Persistent daemon: mod_perl, Plack,
FastCGI
● Buffer your output
● Size-limiting or auto restarts