Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
EC2 Varnish
@mirakui
※
BEFORE TOFU               app               app                app              apache              apache
tofu
AFTER TOFU             app             app              app              tofu             apache
http://tofu/recipes/1237075/100x141c/0b9c3ad1cba65869058e17cf78988bcb.jpg
http://tofu/recipes/        1237075/100x141c/0b9c3ad1cba65869058e17cf78988bcb.jpg
‘100’‘100x100’‘100x100c’‘100x100c40_198_137_104_300’
DEMO
! Apache module (mod_tofu.so)! ImageMagick(Wand)! Amazon S3
akamai (cdn)               ELBApache     Apache            Apache(mod_tofu) (mod_tofu)   …    (mod_tofu)                  ...
Akamai
7000rps            akamai (cdn)                     hit90%      700rps             ELB          Apache     Apache         ...
akamai (cdn)                     hit90%               ELB                        24           CACHE(?)                    ...
akamai (cdn)               ELB     Varnish            VarnishApache     Apache            Apache(mod_tofu) (mod_tofu)    …...
EC2+Varnish
1stchallenge
1st challenge         EC2      m2.xlarge      EBS    (17.1GB mem)    100GB                     swap    Varnish 2.1.5   sto...
m2.xlarge(17.1GB) varnish 2+ EBS(100GB swap)300req/s    17.1GB + EBS100G       110GB                    60%               ...
17.1GB      Varnish                swapLoadAverage      →Varnish
2ndchallenge
2nd challenge        EC2     m2.xlarge      EBS   (17.1GB mem)    100GB                    ext3   Varnish 2.1.5   storage:...
file storage OS
file storage OS restart
EC2 VarnishI/O
Varnish3persistent storage restart              file storagehash director varnish        consistent hashing
…
instance    cores   memory     pricem1.large      2       7.5gb    23,904/m1.xlarge     4       15gb     47,808/c1.xlarge ...
akamai (cdn)                                      tofu               ELB     Varnish            VarnishApache     Apache  ...
cache    …
DISK I/O EC2 varnish   m2.2xlargefile storagevarnish
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
EC2とVarnishで画像配信
Upcoming SlideShare
Loading in …5
×

EC2とVarnishで画像配信

15,216 views

Published on

どうも、クックパッドの画像配信野郎mirakuiです。Varnish 3 のリリースに合わせて行われたVarnish勉強会「Tokyo.vcl」の第一回で発表したスライドです。

Published in: Technology
  • Be the first to comment

EC2とVarnishで画像配信

  1. 1. EC2 Varnish
  2. 2. @mirakui
  3. 3.
  4. 4. BEFORE TOFU app app app apache apache
  5. 5. tofu
  6. 6. AFTER TOFU app app app tofu apache
  7. 7. http://tofu/recipes/1237075/100x141c/0b9c3ad1cba65869058e17cf78988bcb.jpg
  8. 8. http://tofu/recipes/ 1237075/100x141c/0b9c3ad1cba65869058e17cf78988bcb.jpg
  9. 9. ‘100’‘100x100’‘100x100c’‘100x100c40_198_137_104_300’
  10. 10. DEMO
  11. 11. ! Apache module (mod_tofu.so)! ImageMagick(Wand)! Amazon S3
  12. 12. akamai (cdn) ELBApache Apache Apache(mod_tofu) (mod_tofu) … (mod_tofu) S3
  13. 13. Akamai
  14. 14. 7000rps akamai (cdn) hit90% 700rps ELB Apache Apache Apache (mod_tofu) (mod_tofu) … (mod_tofu) S3
  15. 15. akamai (cdn) hit90% ELB 24 CACHE(?) hit60%Apache Apache Apache(mod_tofu) (mod_tofu) … (mod_tofu) S3
  16. 16. akamai (cdn) ELB Varnish VarnishApache Apache Apache(mod_tofu) (mod_tofu) … (mod_tofu) S3
  17. 17. EC2+Varnish
  18. 18. 1stchallenge
  19. 19. 1st challenge EC2 m2.xlarge EBS (17.1GB mem) 100GB swap Varnish 2.1.5 storage: malloc, 100GB
  20. 20. m2.xlarge(17.1GB) varnish 2+ EBS(100GB swap)300req/s 17.1GB + EBS100G 110GB 60% OS SWAP
  21. 21. 17.1GB Varnish swapLoadAverage →Varnish
  22. 22. 2ndchallenge
  23. 23. 2nd challenge EC2 m2.xlarge EBS (17.1GB mem) 100GB ext3 Varnish 2.1.5 storage: file, 100GB
  24. 24. file storage OS
  25. 25. file storage OS restart
  26. 26. EC2 VarnishI/O
  27. 27. Varnish3persistent storage restart file storagehash director varnish consistent hashing
  28. 28.
  29. 29. instance cores memory pricem1.large 2 7.5gb 23,904/m1.xlarge 4 15gb 47,808/c1.xlarge 8 7gb 47,808/m2.xlarge 2 17.1gb 35,868/m2.2xlarge 4 34.2gb 71,712/m2.4xlarge 8 68.48gb 142,826/ ……
  30. 30. akamai (cdn) tofu ELB Varnish VarnishApache Apache ApacheApache ApacheApache(mod_tofu) (mod_tofu) … (mod_tofu) (mod_tofu) (mod_tofu) (mod_tofu) S3
  31. 31. cache …
  32. 32. DISK I/O EC2 varnish m2.2xlargefile storagevarnish

×