Wwc london-perf-apps

14
Performance Tips For Apps

Transcript of Wwc london-perf-apps

Page 1: Wwc london-perf-apps

Performance Tips For Apps

Page 2: Wwc london-perf-apps

About Me

clairettran

Page 3: Wwc london-perf-apps

Performance Is Important

Page 4: Wwc london-perf-apps

Some Common Problems

Note: not an exhaustive list

Page 5: Wwc london-perf-apps

What I’ll Cover

● Monitoring● Caching● Scaling● Database

+

Page 6: Wwc london-perf-apps

MonitoringHow to know there is a performance problem?

Page 7: Wwc london-perf-apps

Caching

How?● Cache store ● Fragment caching● SQL caching

Page 8: Wwc london-perf-apps

Caching

Before: No Caching

After: With Caching!

Problem: Page making many external requests

Page 9: Wwc london-perf-apps

Scaling

Load Balancer

Cache Cluster

Edge Cache / CDN

Page 10: Wwc london-perf-apps

Database

● Add an index● Profiling● Batch queries● Eager fetching● Denormalisation● Sharding

Page 11: Wwc london-perf-apps

Other Techniques● Queuing/Background Jobs● Caching tech (e.g.

Elasticache)● Dedicated services● Rails engines● C-extensions (gems)● Sprites● Asset pipeline● Cache control headers● Gzip assets*● Less HTTP requests● Dedicated Search Service

● Remove unused assets● Static cluster● AWS Auto-scaling● Edge Caching (Akamai, Cloudfront)● YSlow● Local Storage● Smaller Responses● Async JS● Chrome DevTools● Ruby Flavours e.g. JRuby● Asynchronous tasks

Page 12: Wwc london-perf-apps

Further Reading

https://github.com/ianheggie/health_check

http://guides.rubyonrails.org/caching_with_rails.html

http://railscasts.com/episodes/380-memcached-dalli

https://developers.google.com/events/io/sessions/324511365

http://railscasts.com/episodes/366-sidekiq

http://www.slideshare.net/derekmbrown/netflix-strategic-performance-analysis

http://blog.jphpsf.com/2012/04/28/front-end-performance-case-study-github

Page 13: Wwc london-perf-apps
Page 14: Wwc london-perf-apps

Questions