Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Application Delivery and Acceleration with NGINX

Application Delivery and Acceleration with NGINX

For the recorded webinar, visit nginx.com/webinars.

NGINX is an HTTP request and load balancing server that powers many of the world's busiest websites. Learn why NGINX is such a popular choice, and see how it improves the capacity of web applications through HTTP intelligence and caching.

NGINX Inc

March 12, 2014
Tweet

More Decks by NGINX Inc

Other Decks in Technology

Transcript

  1. About this webinar NGINX is an HTTP request and load

    balancing server that powers many of the world's busiest websites. Learn why NGINX is such a popular choice, and see how it improves the capacity of web applications through HTTP intelligence and caching.
  2. Why  is  page  speed  important?   •  We  used  to

     talk  about  the  ‘N  second  rule’:   – 10-­‐second  rule  (Jakob  Nielsen,  March  1997)   – 8-­‐second  rule  (Zona  Research,  June  2001)   – 4-­‐second  rule  (Jupiter  Research,  June  2006)   – 3-­‐second  rule  (PhocusWright,  March  2010)  
  3. …  then  Google  changed  the  game     “We  want

     you  to  be  able  to  get   from  one  page  to  another  as   quickly  as  you  turn  the  page  on   a  book”     Urs  Hölzle,  Google      
  4. The  costs  of  poor  performance   •  Google:  search  enhancements

     cost  0.5s  page  load   –  Ad  CTR  dropped  20%   •  Amazon:  ArZficially  increased  page  load  by  100ms   –  Customer  revenue  dropped  1%   •  Walmart,  Yahoo,  Shopzilla,  Edmunds,  Mozilla…     –  All  reported  similar  effects  on  revenue   •  Google  Pagerank  –  Page  Speed  affects  Page  Rank   –  Time  to  First  Byte  is  what  appears  to  count  
  5. What  is  NGINX?   Internet N Web Server Serve content

    from disk Application Server FastCGI, uWSGI, Passenger… Proxy Caching, Load Balancing… HTTP traffic þ Application Acceleration þ SSL and SPDY termination þ Performance Monitoring þ High Availability Advanced Features: þ Bandwidth Management þ Content-based Routing þ Request Manipulation þ Response Rewriting þ Authentication þ Video Delivery þ Mail Proxy þ GeoLocation
  6. Three  steps  to  a  faster  website   Offload  HTTP  “Heavy

     Liking”     Cache  common  responses     Compress  data  to  reduce  bandwidth  
  7. Hundreds  of  concurrent   connecZons…   require  hundreds  of  heavyweight

      threads  or  processes…   compeZng  for  limited     CPU  and  memory   What  is  the  challenge  with  HTTP?   Client-­‐side:   Slow  network   MulZple  connecZons   HTTP  Keepalives   Server-­‐side:   Limited  concurrency  
  8. Let’s  try  an  example…   •  Client  opens  8  connecZons,

     4  requests  in  each  (32  req)   •  Average  request  processing  Zme  is  <10ms  (single  core)   •  Average  client  write  is  80ms,  average  read  160ms   •  One  client  can  occupy  8  concurrency  slots  for  60+  seconds   r   w   250ms   r   w   250ms   r   w   250ms   r   w   250ms   60  seconds  or  more…   Idle  keepalive   x  8  
  9. Hundreds  of  concurrent   connecZons…   handed  by  a  small

     number  of   mulZplexing  processes,…   typically  one  process   per  core   NGINX  architecture  
  10. NGINX  transforms  applicaZon  performance   •  NGINX  has  almost-­‐unlimited  concurrency

      – Transforms  worst-­‐case  traffic  to  best-­‐case   – Maximizes  applicaZon  uZlizaZon   Internet N Slow, high-concurrency internet-side traffic Fast, efficient local-side traffic
  11. 2.  Cache  common  responses   GET  /logo.png   GET  /logo.png

      N Hybrid  on-­‐disk  and   in-­‐memory  cache  
  12. What  about  dynamic  content?   •  Some  content  appears  to

     be  uncacheable     – Use  client-­‐side  or  server-­‐side  page  assembly   – Use  cache  keys   – Use  cache  purging   – Use  fast  cache  Zmes  
  13. 3.  Compress  data  to  reduce  bandwidth   •  Reduce  bandwidth

     requirements  per  client   – Content  Compression  reduces  text  and  HTML   •  Typically  about  70%  reducZon   – Image  resampling  reduces  JPEG  size  
  14. Three  steps  to  a  faster  website   Offload  HTTP  “Heavy

     Liking”     Cache  common  responses     Compress  data  to  reduce  bandwidth  
  15. Closing  thoughts   •  37%  of  the  busiest  websites  use

     NGINX   –  In  most  situaZons,  it’s  a  drop-­‐in  extension   •  Check  out  the  blogs  on  nginx.com   •  Future  webinars:  nginx.com/webinars   Try  NGINX  F/OSS  (nginx.org)  or  NGINX  Plus  (nginx.com)