Advertisement
Advertisement

More Related Content

Advertisement
Advertisement

Making dynamic sites scale like static sites

  1. Making dynamic sites scale like static sites Wim Godden Cu.be Solutions
  2. Owner of Cu.be Solutions (http://cu.be)
  3. PHP developer since 1997
  4. Developer of OpenX
  5. Zend Certified Engineer
  6. Zend Framework Certified Engineer
  7. MySQL Certified Developer
  8. System/network engineers ?
  9. Managers ?
  10. Varnish ?
  11. Nginx ?
  12. Making dynamic sites scale like static sites (aka "Nginx-PHP on steroids") Wim Godden Cu.be Solutions
  13. Reverse proxy cache / http accelerator / …
  14. Caches (parts of) pages in memory
  15. Nginx usually scales better (but doesn't have VCL)
  16. Images, js, css
  17. Very large files (it's not a file server !)
  18. Requests with Set-Cookie
  19. User-specific content
  20. ESI -> no caching on user-specific content ? Logged in as : Wim Godden 5 messages TTL = 5min TTL=1h TTL = 0s ?
  21. Dynamic content Request Varnish Ideally user X : /top /top request to Apache same user Y : /top /top request to Apache same user X : /top /top request to Apache if unchanged : served from cache user Y : /top /top request to Apache if unchanged : served from cache
  22. Coming to Nginx soon... Logged in as : Wim Godden 5 messages NEWS Menu
  23. Coming to Nginx soon... <esim:include src=&quot;/news&quot; ttl=&quot;5m&quot; /> <esim:include src=&quot;/menu&quot; ttl=&quot;1h&quot; /> <esim:include src=&quot;/top&quot; usesession=&quot;1&quot; ttl=&quot;1h&quot; />
  24. Requesting /page (1 st time) Nginx /page /page
  25. Requesting /page ESI subrequests (1 st time) Nginx /menu.php /news.php /top.php ($sessionid$)
  26. Requesting /page (next time) Nginx /page /menu.php /news.php /top.php ($sessionid$) /page
  27. No hits for user-specific content
  28. Not even for non-specific content
  29. Do we need TTLs ? Logged in as : Wim Godden 5 messages <esim:include src=&quot;/news&quot; ttl=&quot;5m&quot; /> <esim:include src=&quot;/menu&quot; ttl=&quot;1h&quot; /> <esim:include src=&quot;/top&quot; usesession=&quot;1&quot; ttl=&quot;1h&quot; />
  30. Not for user-specific content
  31. TTL for user-specific content is required (defaults to 5min)
  32. How many Memcache requests ? Logged in as : Wim Godden 5 messages <esim:include src=&quot;/news&quot; ttl=&quot;5m&quot; /> <esim:include src=&quot;/menu&quot; ttl=&quot;1h&quot; /> <esim:include src=&quot;/top&quot; usesession=&quot;1&quot; ttl=&quot;1h&quot; />
  33. Local = faster
  34. Easier to debug performance issues (esp. with slow script feature)
  35. Stable : Feb 2012
  36. Web http://techblog.wimgodden.be
  37. Slides http://www.slideshare.net/wimg
  38. E-mail [email_address]
Advertisement