Just a millisecond_

  • 817 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
817
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
10
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Just a millisecond
    Achieving performance without ramping up the hardware
  • 2.  
    Rick van Hattem
    Thierry Schellenbach
  • 3. Twitter/Digg for fashion addicts
  • 4. Too much love
  • 5. 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
  • 6. 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
  • 7.
  • 8. Solution
    Combination of:
    - SSI (server side includes)
    - Javascript
    - NGINX scripting
    Inspired by
    David Cramer (http://bit.ly/WdEbR)
    IBM devworks (http://bit.ly/6vtKlv)
  • 9. 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": {}
    });
  • 10. Handling the loves (SSI & Javascript)
    Request more data when logged in
    <!--# if expr="$cookie_uid" -->
        varasyncData = <!--# include virtual="%s?%s" -->;
    <!--# endif -->
  • 11. Login header
               
    Simple NGINX scripting:
         <!--# if expr="$cookie_username" -->
                <div id="box_loggedin">
                    ...
                </div>
        <!--# else -->
                <div id="box_login">
                   ...
                </div>
        <!--# endif -->
  • 12. Result
    Nginx supported
  • Thanks
    Tutorial & code available soon at:
    mellowmorning.com