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
Transcript
31 slides
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
More Decks by Ryan Bigg
See All by Ryan Bigg
Hiring Juniors - RubyConf Indonesia 2019 Closing Keynote
radar
1
480
Web Directions - Code Leaders - Hiring Juniors
radar
0
730
The Future of Rails - Take 2
radar
0
170
The Future of Rails
radar
1
190
Exploding Rails
radar
9
1.9k
Hiring Juniors
radar
2
500
The Perfect Coding Test
radar
0
170
Your First Developer Job
radar
1
140
Hiring Juniors
radar
2
320
Other Decks in Programming
See All in Programming
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
250
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
200
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
420
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
220
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
420
Crash Auto Pipelines
veronikapj
1
430
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
290
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
780
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
12k
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.3k
Beyond Chatbots: Agentic UI with Open Standards @W-JAX 2026, München
manfredsteyer
PRO
0
110
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
210
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.9k
Technical Leadership for Architectural Decision Making
baasie
4
650
Evolving SEO for Evolving Search Engines
ryanjones
0
360
Agile that works and the tools we love
rasmusluckow
331
22k
How to Ace a Technical Interview
jacobian
280
24k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
240
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
RailsConf 2023
tenderlove
30
1.6k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
Amusing Abliteration
ianozsvald
1
390
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.3k
Become a Pro
speakerdeck
PRO
31
6.4k