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
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
330
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
330
カツオ、ご期待ください
suneo3476
0
120
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
1k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
iOSDC2026登壇資料.pdf
riofujimon
0
200
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
310
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
280
すこし踏み込む CancellationToken
htkym
2
1.5k
一人だけ、Kiroが静止する日
hideg
0
140
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
270
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.6k
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
340
Prompt Engineering for Job Search
mfonobong
0
460
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.7k
GitHub's CSS Performance
jonrohan
1033
470k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
How to Think Like a Performance Engineer
csswizardry
28
2.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Code Reviewing Like a Champion
maltzj
528
40k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
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