Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Scaling Spree's API
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ryan Bigg
February 27, 2014
Programming
200
0
Share
Scaling Spree's API
Ryan Bigg
February 27, 2014
More Decks by Ryan Bigg
See All by Ryan Bigg
Hiring Juniors - RubyConf Indonesia 2019 Closing Keynote
radar
1
450
Web Directions - Code Leaders - Hiring Juniors
radar
0
690
The Future of Rails - Take 2
radar
0
140
The Future of Rails
radar
1
160
Exploding Rails
radar
9
1.9k
Hiring Juniors
radar
2
470
The Perfect Coding Test
radar
0
140
Your First Developer Job
radar
1
120
Hiring Juniors
radar
2
290
Other Decks in Programming
See All in Programming
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
180
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
510
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
350
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
920
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
150
20260514_its_the_context_window_stupid.pdf
heita
0
1k
Sans tests, vos agents ne sont pas fiables
nabondance
0
110
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
160
🦞OpenClaw works with AWS
licux
1
360
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
1
130
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
160
Agentic Elixir
whatyouhide
0
450
Featured
See All Featured
Building an army of robots
kneath
306
46k
Git: the NoSQL Database
bkeepers
PRO
432
67k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
300
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
1.4k
GitHub's CSS Performance
jonrohan
1033
470k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
140
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
540
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
350
WENDY [Excerpt]
tessaabrams
10
37k
Claude Code のすすめ
schroneko
67
220k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
360
Transcript
Scaling Spree
None
Rendered spree/api/products/index.v1.rabl ! in 1760.2ms
! cache @product api/app/views/spree/api/products/show.v1.rabl
Rendered spree/api/products/index.v1.rabl ! in 79.7ms 22x faster!
None
DO: 2GB Droplet (SFO) Apache Bench (ab) Benchmarker
DO: 2GB Droplet (NYC) Spree: master stock nginx + puma
Test Server
requests=1000, concurrency=50! ! Requests per second: 11.38
requests=10000,! concurrency=500! ! Requests per second: N/A! Load average: 26.14!
DO: 4GB droplet! ! Requests per second: N/A! Total of
33 requests completed!
nginx sez:! ”512 worker_connections not enough"
! *Google for "nginx worker_connections"* ! ! events {! worker_connections
19000;! }! ! worker_rlimit_nofile 20000;
! requests=1000, concurrency=500! ! Requests per second: 39.84 3.5x faster!!
Percentage of the requests served within a certain time (ms)!
50% 6379! …! 75% 10297! …! 100% 25090 (longest request)
Percentage of the requests served within a certain time (ms)!
50% 6379! …! 75% 10297! …! 100% 25090 (longest request)
1 [|||||||||||||||||||||||||||||||||||||100.0%] 2 [|||||||||||||||||||||||||||||||||||||100.0%]
DO: 32GB droplet, 12 cores!
39 req/s x 6?! 2 cores => 12 cores! ~10x
faster?!
! requests=1000, concurrency=500! ! Requests per second: 58.84 [#/sec] (mean)
5.2x faster!!
! expires_in 3.minutes api/app/controllers/spree/products_controller.rb
None
! requests=1000, concurrency=500! ! Requests per second: 529.19 [#/sec] (mean)
48x faster!!
None
! requests=1000, concurrency=500! ! Requests per second: ! 1705.49 155x
faster!!
! requests=10000, concurrency=1000! ! Requests per second: ! 1859 169x
faster!!
CACHE EXPIRY?! !1
None
Purge everything Purge by key Purge by URL
Purging by key headers[‘Surrogate-Key’] = “product_id=1” headers[‘Surrogate-Key’] =! “product_id=1 taxon_id=1
taxon_id=2”! !
Purging URLs /api/products! ! /products/ruby-on-rails-tote