SlideShare a Scribd company logo
Rails Performance
    When, What and How




                  Vitaly Kushner
                    @vkushner
Vitaly Kushner
programming since middle 80s
 professionally since early 90s
       Rails since 2005
   founded Astrails in 2008
http://astrails.com/blog
performance
slow
for whatever reason
performance
performance

• raw speed
• throughput
• scalability
• end-user
No time
to dive into details
When to optimize?
     and when not to.
what to do with 1M
       users
Celebrate!
 you’ve made it.
why startups fail?
NOT because of
performance problems
1 million users
first 1000 users!
have scalability
   problem?
GREAT!
because it means you grow fast
later
Scalability Plan


• understand the limits
• know your next step
performance
  does it matter?
YES!
performance is very important
Is 1% a lot?
yes, if you are Google.
Why not to optimize
     anyway?
time and budget
    usually limited
Measure
You can not improve what you do not measure.
Tools
• Yahoo Yslow
  http://developer.yahoo.com/yslow/


• Google PageSpeed
  https://developers.google.com/speed/pagespeed


• NewRelic -     http://newrelic.com


• httperf & ab
• Blitz.io
limit number of records
       from the database
oink
https://github.com/noahd1/oink
Instantiation Breakdown: Total: 14 |
User: 4 | Experience: 3 | Location: 3 |
Interest: 3 | Admin: 1
limit number of queries
     prevent 1+N queries problem
bullet
https://github.com/flyerhzm/bullet
N+1 Query detected
Experience => [:interest]
Add to your finder: :include => [:interest]
define indexes
   can be done later
query_reviewer
https://github.com/nesquena/query_reviewer
limit number of http
       requests
        consolidate assets
   assets pipeline makes it easy
css at the top
js at the bottom
 improves perceived page speed
low level hacks


• replace :include with :join
• explicit :select
not recommened
Maintainability
 usually better then speed
low hanging fruits

• compress and http cache assets
• CDN libraries
• image sprites
• bundle images into CSS
• CDN for all static assets
Caching
 much later
real performance
    problem?
next time...
Thank you!
Slides and video will be published at
      http://astrails.com/blog




                         Vitaly Kushner
                           @vkushner

More Related Content

ODP
Cvcc performance tuning
PDF
Seven Jobs You Should Be Running #sqlsat126
KEY
Windycityrails page performance
KEY
Freelancing and side-projects on Rails
KEY
improving the performance of Rails web Applications
KEY
Cloud tools
KEY
Becoming a more productive Rails Developer
PDF
New Server in an Hour
Cvcc performance tuning
Seven Jobs You Should Be Running #sqlsat126
Windycityrails page performance
Freelancing and side-projects on Rails
improving the performance of Rails web Applications
Cloud tools
Becoming a more productive Rails Developer
New Server in an Hour

What's hot (20)

PPT
Windy cityrails performance_tuning
PPTX
WordPress Optimization - Pubcon Las Vegas 2014
PDF
Optimera STHLM 2011 - Mikael Berggren, Spotify
PDF
Responsive images
PPTX
WTF: Where To Focus when you take over a Drupal project
PDF
No More Cowboy Coding: Modern WordPress Development Workflow That Scales
PPTX
Standardizing WordPress Workflow
PPT
Jira and Confluence - How the company behind those products works - Anatoli K...
PDF
Migrate PHP E-Commerce Site to Go
PPTX
Optimizing Wordpress Pubcon New Orleans 2014
PPTX
Why Enterprises Are Embracing the Cloud
PPTX
Untangling the web week 2 - SEO
PPTX
Front End page speed performance improvements for Drupal
PPTX
14 Habits of Great SQL Developers
PDF
Python to go
PDF
DevOps for Drupal: Why We Cook With Chef
PPTX
Exploring Content API Options - March 23rd 2016
PDF
Challenges of moving a java team to scala
PDF
Kanban stand-up meetings
Windy cityrails performance_tuning
WordPress Optimization - Pubcon Las Vegas 2014
Optimera STHLM 2011 - Mikael Berggren, Spotify
Responsive images
WTF: Where To Focus when you take over a Drupal project
No More Cowboy Coding: Modern WordPress Development Workflow That Scales
Standardizing WordPress Workflow
Jira and Confluence - How the company behind those products works - Anatoli K...
Migrate PHP E-Commerce Site to Go
Optimizing Wordpress Pubcon New Orleans 2014
Why Enterprises Are Embracing the Cloud
Untangling the web week 2 - SEO
Front End page speed performance improvements for Drupal
14 Habits of Great SQL Developers
Python to go
DevOps for Drupal: Why We Cook With Chef
Exploring Content API Options - March 23rd 2016
Challenges of moving a java team to scala
Kanban stand-up meetings
Ad

Viewers also liked (7)

PPTX
45 lessons in life
DOC
Bentancor, luis los techos vegetales
DOCX
Evidenceofa singleeditorialhandinluke4and7
PDF
"Attribution Marketing Tailored for Your Business"
PDF
dConstruct Workshop - Positive Behaviors
PDF
RubyMotion: Put your Dreams in Motion with Ruby
PDF
Rails missing features
45 lessons in life
Bentancor, luis los techos vegetales
Evidenceofa singleeditorialhandinluke4and7
"Attribution Marketing Tailored for Your Business"
dConstruct Workshop - Positive Behaviors
RubyMotion: Put your Dreams in Motion with Ruby
Rails missing features
Ad

Similar to Performance - When, What and How (20)

PPT
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
PPTX
Building Scalable Web Apps - LVL.UP KL
PDF
Client Side Measurement & Performance With Rails
PPTX
Boosting the Performance of your Rails Apps
KEY
Keeping Rails on the Tracks
PPTX
Approaches for application request throttling - Cloud Developer Days Poland
PDF
Rails App performance at the limit - Bogdan Gusiev
PDF
Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, ...
PPTX
Approaches to application request throttling
PPTX
VISUG - Approaches for application request throttling
PPTX
Approaches for application request throttling - dotNetCologne
PPT
scale_perf_best_practices
PPT
Ruby On Rails Presentation
PDF
Scaling Rails for $5.50 per day - October 2014 ATLRUG Presentation
PPTX
ConFoo Montreal - Approaches for application request throttling
PPTX
Web Application Performance
KEY
Social dev camp_2011
PPTX
Day 7 - Make it Fast
PDF
Ways to minimise performance risks in continuous delivery
PPTX
Building high performance and scalable share point applications
Ruby on Rails Performance Tuning. Make it faster, make it better (WindyCityRa...
Building Scalable Web Apps - LVL.UP KL
Client Side Measurement & Performance With Rails
Boosting the Performance of your Rails Apps
Keeping Rails on the Tracks
Approaches for application request throttling - Cloud Developer Days Poland
Rails App performance at the limit - Bogdan Gusiev
Rails is not enough, by Javier Ramirez, at Conferencia Rails 2010 in Madrid, ...
Approaches to application request throttling
VISUG - Approaches for application request throttling
Approaches for application request throttling - dotNetCologne
scale_perf_best_practices
Ruby On Rails Presentation
Scaling Rails for $5.50 per day - October 2014 ATLRUG Presentation
ConFoo Montreal - Approaches for application request throttling
Web Application Performance
Social dev camp_2011
Day 7 - Make it Fast
Ways to minimise performance risks in continuous delivery
Building high performance and scalable share point applications

More from Astrails (10)

PDF
Building and deploying React applications
PDF
Accounting For Hackers
PDF
Machine Learning: Make Your Ruby Code Smarter
PDF
Migrating from Flux to Redux. Why and how.
PDF
Engineering esthetics
PDF
Lean Software Development
PDF
WTF is NoSQL
PDF
Cassandra intro
PDF
Ruby is an Acceptable Lisp
PDF
Ruby is Awesome
Building and deploying React applications
Accounting For Hackers
Machine Learning: Make Your Ruby Code Smarter
Migrating from Flux to Redux. Why and how.
Engineering esthetics
Lean Software Development
WTF is NoSQL
Cassandra intro
Ruby is an Acceptable Lisp
Ruby is Awesome

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Advanced Soft Computing BINUS July 2025.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
KodekX | Application Modernization Development
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Cloud computing and distributed systems.
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Advanced IT Governance
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Monthly Chronicles - July 2025
Advanced Soft Computing BINUS July 2025.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
Understanding_Digital_Forensics_Presentation.pptx
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Electronic commerce courselecture one. Pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KodekX | Application Modernization Development
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Cloud computing and distributed systems.
madgavkar20181017ppt McKinsey Presentation.pdf
Spectroscopy.pptx food analysis technology
Advanced IT Governance

Performance - When, What and How