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
Scaling Spree's API
Search
Ryan Bigg
February 27, 2014
Programming
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
470
Web Directions - Code Leaders - Hiring Juniors
radar
0
720
The Future of Rails - Take 2
radar
0
170
The Future of Rails
radar
1
180
Exploding Rails
radar
9
1.9k
Hiring Juniors
radar
2
500
The Perfect Coding Test
radar
0
160
Your First Developer Job
radar
1
130
Hiring Juniors
radar
2
310
Other Decks in Programming
See All in Programming
AWSに止められる覚悟してますか?
morizo_1984
2
520
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.5k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
580
wkhtmltopdfの次どうするか問題2026
willnet
2
1.9k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
360
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.4k
contenteditable と日本語入力に向き合う
colorful12
0
180
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
170
速習iPhone Duo対応
yuukiw00w
2
970
Are APIs Still Relevant in the AI Era?
soyuka
0
440
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.3k
Writing Fast Ruby
sferik
630
63k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
370
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
530
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
580
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
870
30 Presentation Tips
portentint
PRO
1
420
New Earth Scene 8
popppiees
4
2.7k
Docker and Python
trallard
47
4.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
Claude Code のすすめ
schroneko
67
230k
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