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
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
190
Writing config files in Ruby
arnvald
0
190
Speaking at RDRC
arnvald
0
180
Read more
arnvald
2
140
The simplest gem you'll ever use
arnvald
0
150
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
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
280
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
17
15k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
260
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
130
Java 27新機能 / Java 27 new features
kishida
2
170
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
510
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
360
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
FreeBSDでZabbixを動かす
kenkino
0
320
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
520
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
160
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
300
SEO for Brand Visibility & Recognition
aleyda
0
4.7k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
610
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
710
Producing Creativity
orderedlist
PRO
348
41k
Darren the Foodie - Storyboard
khoart
PRO
4
3.9k
Deep Space Network (abreviated)
tonyrice
0
320
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
770
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.9k
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