Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Your API is too slow!
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Grzegorz Witek
June 23, 2016
Programming
770
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Your API is too slow!
RedDotRubyConf 2016
Grzegorz Witek
June 23, 2016
More Decks by Grzegorz Witek
See All by Grzegorz Witek
One Year with Hanami
arnvald
0
120
Coercion in Ruby
arnvald
1
200
Writing config files in Ruby
arnvald
0
190
Speaking at RDRC
arnvald
0
190
Read more
arnvald
2
150
The simplest gem you'll ever use
arnvald
0
160
International to global
arnvald
0
160
Patterns, patterns everywhere
arnvald
0
170
Nomadic programmer - Baruco 2014 edition
arnvald
0
150
Other Decks in Programming
See All in Programming
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
150
ChromeでローカルLLM
ryu1013
0
140
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
780
Androidだけじゃない、DroidKaigiで広がった私の技術スタック
akkeylab
0
130
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.1k
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
530
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
230
Featured
See All Featured
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
WCS-LA-2024
lcolladotor
0
890
The Pragmatic Product Professional
lauravandoore
37
7.5k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
950
Optimising Largest Contentful Paint
csswizardry
37
4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
270
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
Done Done
chrislema
187
17k
Transcript
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW!
None
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW!
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW! 2TQDCDN[ HCUVGPQWIJ
Grzegorz Witek
is speed a feature?
is lack of speed a bug?
Algolia Github
Web application optimization loading priority static content dynamic content domain
sharing JavaScript compression asset minifying CSS HTML un-CSS prefetching HTTP/2 image sprites CDN database optimization multi-threading
Web API optimization loading priority static content dynamic content domain
sharing JavaScript compression asset minifying CSS HTML un-CSS prefetching HTTP/2 image sprites CDN database optimization multi-threading
Long way of a request ! " #
Latency ! " #
Where are your users? "
Where are your users? " Singapore Jakarta 13ms
Where are your users? " Singapore Hanoi 100ms
Where are your users? " Singapore New York 265ms
Where are your users? " Singapore Shanghai 320ms
Dynamic content acceleration ! CDN #
Latency
Latency
Long way of a request ! " #
Processing #
Don’t be a smart-ass “Oh, I know, we have to
cache it!”
Measure gem 'ruby-prof' gem 'rack-mini-profiler'
Measure in production mode pre-production stage
Measure gem 'newrelic' gem 'skylight'
Measure profile - focus on the slowest part
Measure benchmark - compare alternative solutions
Improve
Improve Rely on your database
Improve Where is your cache?
Improve Redis on a separate machine - fast Redis on
the same machine - faster Application memory - the fastest
Improve Multi-layered cache (Russian doll caching)
Improve When needed - mutate
Improve Upgrade your libraries
Improve When needed - replace your libraries
Improve gem 'json' gem 'oj' gem 'oj-mimic-json'
Improve Native extensions - not only C!
Improve https://github.com/rustbridge/helix https://github.com/d-unseductable/ruru
Improve Move processing to the background
Improve When desperate - extract part of the application
Improve I said "when desperate" not "ASAP NOW!!!11"
Improve I said "part", not "rewrite everything in Go"
Improve There's more, way more
Long way of a request ! " #
Download ! " #
Improve Not only GZIP
Long way of a request ! " #
Speed up your API use CDN infrastructure profile and benchmark
focus on the slowest part rewriting is the last thing to consider
Speed up your API Ruby is fast enough Sinatra is
fast enough Rails is fast enough
@arnvald, RedDotRubyConf 2016 YOUR API IS TOO SLOW! 2TQDCDN[ HCUVGPQWIJ