Your SlideShare is downloading. ×
0
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Just a millisecond_
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Just a millisecond_

851

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
851
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
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

×