Just a millisecond_
Upcoming SlideShare
Loading in...5
×
 

Just a millisecond_

on

  • 1,186 views

 

Statistics

Views

Total Views
1,186
Views on SlideShare
1,153
Embed Views
33

Actions

Likes
0
Downloads
10
Comments
0

2 Embeds 33

http://www.slideshare.net 27
http://www.linkedin.com 6

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Just a millisecond_ Just a millisecond_ Presentation Transcript

    • Just a millisecond
      Achieving performance without ramping up the hardware
    •  
      Rick van Hattem
      Thierry Schellenbach
    • Twitter/Digg for fashion addicts
    • Too much love
    • 1st simple step:Cache stuff
      Default approach:
      @cache_page
      def homepage(request):  
          pass
      Static content approach:
      Nginx serves directly from Memcached
      - No apache, django or python overhead
    • Nginx and memcached
      + Really fast
      The social web
      Pages are different for
      each user
      Can't cache
      much of anything
      Tutorial and benchmark at:
      http://bit.ly/BKMb
    • Solution
      Combination of:
      - SSI (server side includes)
      - Javascript
      - NGINX scripting
      Inspired by
      David Cramer (http://bit.ly/WdEbR)
      IBM devworks (http://bit.ly/6vtKlv)
    • Solution overview
      - Memcached holds an anonymous page.
      - Template knows how to make it personal if needed
      async.push({
      "user.authenticated": {},
      "entity.loved_by": {
      "entity_ids": [
      17991,
      19164,
      18536,
      17720,
      12044
      ]
      },
      "entity.notifications": {}
      });
    • Handling the loves (SSI & Javascript)
      Request more data when logged in
      <!--# if expr="$cookie_uid" -->
          varasyncData = <!--# include virtual="%s?%s" -->;
      <!--# endif -->
    • Login header
                 
      Simple NGINX scripting:
           <!--# if expr="$cookie_username" -->
                  <div id="box_loggedin">
                      ...
                  </div>
          <!--# else -->
                  <div id="box_login">
                     ...
                  </div>
          <!--# endif -->
    • Result
      Nginx supported
      • Apache
      • Akamai
      • Varnish
    • Thanks
      Tutorial & code available soon at:
      mellowmorning.com