@mirakui
BEFORE TOFU

               app
               app
                app




              apache
              apache
800
  …
800
  …
800




7,000   /sec
IDC→EC
2
BEFORE TOFU

               app
               app
                app



       NFS




              apache
              apache
BEFORE TOFU

               app
               app
                app



       NFS




              apache
              apache
BEFORE TOFU

               app
               app
                app



       NFS




              apache
              apache
BEFORE TOFU

               app
               app
                app



       NFS




              apache
              apache
NFS
S3
99.999999999%
TOFU
BEFORE TOFU

               app
               app
                app




              apache
              apache
AFTER TOFU

             app
             app
              app




             TOFU
             apache
http://d3921.image.cookpad.com/recipes/
          1237075/100x141c/
0b9c3ad1cba65869058e17cf78988bcb.jpg
http://d3921.image.cookpad.com/recipes/
            1237075/100x141c/
  0b9c3ad1cba65869058e17cf78988bcb.jpg
ID




http://d3921.image.cookpad.com/recipes/
       1237075/100x141c/
0b9c3ad1cba65869058e17cf78988bcb.jpg
http://d3921.image.cookpad.com/recipes/
       1237075/100x141c/
0b9c3ad1cba65869058e17cf78988bcb.jpg
‘100’



‘100x100’


‘100x100c’


‘100x100c40_198_137_104_300’
‘100x100cq10’

‘100x100cq30’

‘100x100cq50’

‘100x100cq70’

‘100x100cq90’
http://d3921.image.cookpad.com/recipes/
          1237075/100x141c/
0b9c3ad1cba65869058e17cf7
        8988bcb.jpg
DEMO
Apache module (mod_tofu.so)




 ImageMagick(Wand)




 Amazon S3
<Location />
    SetHandler tofu
    AWSAccessKeyId AKIXXXXX
    AWSSecretAccessKey XXXXXXXXXXX
    AWSS3BucketName my-tofu-bucket
    </Location>

  s3://my-tofu-bucket/recipes/1234/1234.jpg




http://[host]/recipes/1234/[size]/[hash].jpg
3
TOFU
akamai (cdn)

               ELB
                                          ec2
                                          c1.xlarge
Apache     Apache            Apache
(mod_tofu) (mod_tofu)   …    (mod_tofu)   x6


                        S3
ImageMagick
    OR
  Imlib2
ImageMagick or Imlib2
               Imlib2


Imlib2




          ImageMagick
ImageMagick
ImageMagick




  ImageMagick
EC2
TOFU
akamai (cdn)

               ELB


Apache     Apache            Apache
(mod_tofu) (mod_tofu)   …    (mod_tofu)




                        S3
instance    cores    memory     price

m1.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/




                     $1=83yen, tokyo region
c1.xlarge

8 cores / 20 ECUs

core                c1.xlarge


tofu CPU
S3
S3
2011.4.12
s3::ListAllBuckets




→
  …
S3
Akamai
akamai (cdn)

               ELB


Apache     Apache            Apache
(mod_tofu) (mod_tofu)   …    (mod_tofu)
                                          x6


                        S3
Akamai
                         CDN
(Contents Delivery Network)




                   80%   1hop
           SLA100%
Akamai
OR
CloudFront
CloudFront

AWS      CDN


S3                   EC2


Akamai
(Custom Origin   )
Akamai     CloudFront

 50


37.5


 25


12.5


  0

                ping (msec)



            ※      just-ping.com
Akamai
Akamai
akamai (cdn)                     hit90%

               ELB


Apache     Apache            Apache
(mod_tofu) (mod_tofu)   …    (mod_tofu)




                        S3
akamai (cdn)                     hit90%

               ELB                        24


           CACHE(?)
                                     hit60%
Apache     Apache            Apache
(mod_tofu) (mod_tofu)   …    (mod_tofu)




                        S3
akamai (cdn)

               ELB


     Varnish            Varnish


Apache     Apache            Apache
(mod_tofu) (mod_tofu)    …   (mod_tofu)




                        S3
…
instance    cores   memory     price

m1.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/


                                          ……
akamai (cdn)

               ELB                  tofu



     Varnish            Varnish


Apache     Apache            ApacheApache
                                ApacheApache
(mod_tofu) (mod_tofu)    …   (mod_tofu) (mod_tofu)
                                 (mod_tofu)
                                     (mod_tofu)




                        S3
TOFU


       UP →
料理を楽しくする画像配信システム
料理を楽しくする画像配信システム

料理を楽しくする画像配信システム