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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ryan Bigg
February 27, 2014
Programming
210
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
460
Web Directions - Code Leaders - Hiring Juniors
radar
0
700
The Future of Rails - Take 2
radar
0
150
The Future of Rails
radar
1
170
Exploding Rails
radar
9
1.9k
Hiring Juniors
radar
2
480
The Perfect Coding Test
radar
0
150
Your First Developer Job
radar
1
120
Hiring Juniors
radar
2
300
Other Decks in Programming
See All in Programming
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
150
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
220
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.8k
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
260
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
0
180
関数型プログラミングのメリットって何だろう?
wanko_it
0
160
なぜ関数型プログラミングで「型」と「証明」が語られるのか #fp_matsuri
kajitack
3
770
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
460
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
トークンをケチるな、設計しろ:GitHub Copilotを賢く使うコンテキスト戦略
ochtum
0
310
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.3k
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
Amusing Abliteration
ianozsvald
1
220
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
290
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
300
The Invisible Side of Design
smashingmag
301
52k
Accessibility Awareness
sabderemane
1
150
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
340
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
490
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Code Reviewing Like a Champion
maltzj
528
40k
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