Slides for my talk at BCN WordCamp 2016. Improve the performance of WordPress installations by using the right tool at every corresponding level in the technology stack.
2. puerto:22
ABOUT ME
• Certified System Administrator
• Certified Software Architect
• WordPress enthusiast
• CTO at puerto22.com
@codeheadjavier.rodriguez@puerto22.com
25. puerto:22
METRICS!
• Client: Load time
• Developer Tools, Yslow, PageSpeed, Pingdom
• Server: Requests per second
• ApacheBench, siege, httperf
26. puerto:22
APACHEBENCH
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking demo2.demoinc.com (be patient).....done
Server Software: Apache
Server Hostname: demo2.demoinc.com
Server Port: 80
Document Path: /
Document Length: 10884 bytes
Concurrency Level: 10
Time taken for tests: 15.467 seconds
Complete requests: 100
Failed requests: 0
Total transferred: 1114376 bytes
HTML transferred: 1088400 bytes
Requests per second: 6.47 [#/sec] (mean)
Time per request: 1546.727 [ms] (mean)
Time per request: 154.673 [ms] (mean, across all concurrent requests)
Transfer rate: 70.36 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 54 67 20.9 60 196
Processing: 555 1430 280.4 1466 1808
Waiting: 439 1314 267.0 1369 1644
Total: 615 1497 277.6 1528 1871
Percentage of the requests served within a certain time (ms)
50% 1528
66% 1621
75% 1680
80% 1736
90% 1796
95% 1843
98% 1871
99% 1871
100% 1871 (longest request)
27. puerto:22
SIEGE
** SIEGE 3.0.8
** Preparing 20 concurrent users for battle.
The server is now under siege.. done.
Transactions: 2000 hits
Availability: 100.00 %
Elapsed time: 59.53 secs
Data transferred: 6.73 MB
Response time: 0.01 secs
Transaction rate: 33.60 trans/sec
Throughput: 0.11 MB/sec
Concurrency: 0.19
Successful transactions: 2000
Failed transactions: 0
Longest transaction: 0.04
Shortest transaction: 0.00
28. puerto:22
HTTPERF
httperf --hog --timeout=5 --client=0/1 --server=demo2.demoinc.com --port=80 --uri=/
--rate=10 --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
httperf: warning: open file limit > FD_SETSIZE; limiting max. # of open files to
FD_SETSIZE
Maximum connect burst length: 1
Total: connections 100 requests 100 replies 100 test-duration 9.903 s
Connection rate: 10.1 conn/s (99.0 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 2.2 avg 2.8 max 6.8 median 2.5 stddev 0.6
Connection time [ms]: connect 0.7
Connection length [replies/conn]: 1.000
Request rate: 10.1 req/s (99.0 ms/req)
Request size [B]: 77.0
Reply rate [replies/s]: min 10.0 avg 10.0 max 10.0 stddev 0.0 (1 samples)
Reply time [ms]: response 1.8 transfer 0.3
Reply size [B]: header 266.0 content 10884.0 footer 0.0 (total 11150.0)
Reply status: 1xx=0 2xx=100 3xx=0 4xx=0 5xx=0
CPU time [s]: user 3.54 system 6.27 (user 35.7% system 63.3% total 99.1%)
Net I/O: 110.7 KB/s (0.9*10^6 bps)
Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
30. puerto:22
SPEED AND EFFICIENCY
• speed: swiftness or rate of performance or action: velocity
• efficiency: productivity without waste
https://www.merriam-webster.com/
85. puerto:22
SERVER STACK
Operating System
Web Server
PHP RE
WordPress
Theme Plugins
Hardware
Database
SSD, IOPS
Scaling
Cache
Index
Spinoff
Replication
Partitioning
APC
Xcache
varnish
W3 Total Cache
HyperDB
Networking
Resource allocation
89. puerto:22
SUMMARY
• Performance Tuning is a process, not a product.
• Measure. Profile.
• Optimize your WordPress installation prior to scaling.
• Look at the big picture.
• Leverage Caching and Content Delivery Networks.