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_

860

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
860
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
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<br />Achieving performance without ramping up the hardware<br />
  2.  <br />Rick van Hattem<br />Thierry Schellenbach<br />
  3. Twitter/Digg for fashion addicts<br />
  4. Too much love<br />
  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. 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. 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 />
  8. 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 />
  9. 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 />
  10. 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 />
  11. Result<br />Nginx supported<br /><ul><li> Apache
  12. Akamai
  13. Varnish</li></li></ul><li>Thanks<br />Tutorial & code available soon at:<br />mellowmorning.com<br />

×