Your SlideShare is downloading. ×
0
Just a millisecond<br />Achieving performance without ramping up the hardware<br />
 <br />Rick van Hattem<br />Thierry Schellenbach<br />
Twitter/Digg for fashion addicts<br />
Too much love<br />
1st simple step:Cache stuff<br />Default approach:<br />@cache_page<br />def homepage(request):  <br />    pass<br />Stati...
Nginx and memcached<br />+ Really fast<br /> The social web<br /> Pages are different for <br />    each user<br /> Can't ...
Solution<br />Combination of:<br />- SSI (server side includes)<br />- Javascript<br />- NGINX scripting<br />Inspired by<...
Solution overview<br />- Memcached holds an anonymous page.<br />- Template knows how to make it personal if needed<br />a...
Handling the loves (SSI & Javascript)<br />Request more data when logged in<br /><!--# if expr="$cookie_uid" --><br />    ...
Login header<br />           <br />Simple NGINX scripting:<br />     <!--# if expr="$cookie_username" --><br />           ...
Result<br />Nginx supported<br /><ul><li> Apache
Akamai
Upcoming SlideShare
Loading in...5
×

Just a millisecond_

864

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
864
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Just a millisecond_"

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

    Clipping is a handy way to collect important slides you want to go back to later.

×