SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
22.
Database slowness
Many backend performance issues are caused by too many, or
slow queries.
Mysql has a pretty terrible query planner.
Sub-queries and derived table joins will eventually catch fire.
Slow query logs, mtop, or monitoring like new relic are your best
friend.
Saturday, 9 November, 13
23.
Database slowness
Slow query logs - Percona makes great tools for MySQL.
Disable query caching.
Run EXPLAIN on slow queries.
Add indexes/tweak queries, and repeat.
Saturday, 9 November, 13
24.
Explain Queries
Visual explain makes it easier.
Saturday, 9 November, 13
25.
Indexes
Index commonly used columns.
Column order in matters in indexes.
Saturday, 9 November, 13
27.
Caching
Can be expensive to rollout, if you need new infrastructure
Cache expiration is really really hard.
Saturday, 9 November, 13
28.
What to Cache
Results that don’t change often
Use monitoring/analytics to find the busiest pages.
Start using caching there.
Expand once you’ve learned more.
Saturday, 9 November, 13
29.
Where to cache
Hopefully in RAM
Failing that in shared memory
Disk :(
Saturday, 9 November, 13
30.
Optimize cache use
Watch cache miss rate.
Tune cache expiration so you miss less often.
Saturday, 9 November, 13
31.
Guideline
OPTIMIZE CODE LAST,
MOST OF THE TIME
Saturday, 9 November, 13
34.
Javascript tools
Chrome dev tools are the gold standard.
CPU profiles are invaluable.
Heap comparisons can be used to find memory leaks.
Saturday, 9 November, 13
35.
CPU Profiler
Chrome dev tools
Saturday, 9 November, 13
36.
CPU Profiler
Chrome dev tools
Saturday, 9 November, 13
37.
CPU Profiler
Chrome dev tools
Saturday, 9 November, 13
38.
CPU Profiler
Chrome dev tools
Saturday, 9 November, 13
40.
XHProf
PECL extension produced by Facebook.
Captures runtime metrics at a function level.
Possible to use in a sub-sample of production unlike xdebug.
Saturday, 9 November, 13
41.
Xhgui
Nicer UI to XHProf data
Saturday, 9 November, 13
42.
Xhgui
Nicer UI to XHProf data
Saturday, 9 November, 13
43.
XDebug
Not suitable for servers with traffic,
Very detailed results.
Saturday, 9 November, 13