Web Performance Part 3 "Server-side tips"

860 views

Published on

The presentation is devoted to server side tips on improving Web Performance. All 4 presentations will help you reduce latency, enrich optimization of javascript code, discover tricky parts when working with API browser, see best practices of networking and learn lots of other important and interesting things. Enjoy! =)

Published in: Software
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
860
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
18
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Web Performance Part 3 "Server-side tips"

  1. 1. Web Performance Server-side Tips Andrew Kovalenko
  2. 2. Table of contents ➔ Nginx vs Apache ➔ Apache performance tuning ➔ Nginx performance tuning ➔ Web server accelerators ➔ Varnish ➔ PageSpeed module
  3. 3. Total number of websites NetCraft: http://news.netcraft.com/archives/2013/06/06/june-2013-web-server-survey-3.html
  4. 4. Web server developers: Market share of active sites NetCraft: http://news.netcraft.com/archives/2013/06/06/june-2013-web-server-survey-3.html
  5. 5. Nginx vs Apache (requests/seconds) Amazon EC2 Micro Instance Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz 613 MB RAM Ubuntu 13.10 index.html 612 B earth.png 3.7 MB
  6. 6. Nginx vs Apache (memory usage)
  7. 7. Apache basic architecture
  8. 8. Nginx basic architecture
  9. 9. Frontend (Nginx) - backend (Apache) Front end Client Back end ➔ php ... Static content ➔ js ➔ css ➔ images ➔ video ...
  10. 10. Nginx config Light content (html, css, js, xml, rss, txt) Heavy content (photo, video, audio) ➔ g-zip compression ➔ expires headers for content proxy ➔ file descriptor caching ➔ virtual folder for frequently asked content ➔ SSD ➔ cache proxied requests worker_processes, worker_priority, worker_connections, sendfile on, access_log off, tcp_nopush on, gzip on
  11. 11. Apache config Run-TimeCompile-Time ➔ load only required modules ➔ choose appropriate MPM HTTP Compression & Caching ➔ AllowOverride ➔ FollowSymLinks and SymLinksIfOwnerMatch ➔ Content Negotiation ➔ MPM config ➔ KeepAlive and KeepAliveTimeout Accept-Encoding: gzip,deflate Separate Static RewriteCond for images Other configs
  12. 12. Web server accelerators Web server accelerator Compression Operating system Browser Caching Edge Side Includes Prefetching Optimize code Preemptive hostname resolution Ad removal Client aiCache Gzip Linux All Yes No Yes Yes Yes All Apache Traffic Server Linux CACHEbox None Linux All Yes No Yes No No Yes End user/ISP Ishlangu Gzip Linux All Yes No No Yes Yes No All LotServer None Linux, Windows All No No No No No No Content Provider nginx Gzip Unix All Yes No No No Yes No user/ISP Polipo None Unix, Windows All Yes No No No No No user/ISP SiteCelerate Text & Images All Yes No Yes No No No user/ISP Squid None Unix, Windows All Yes Yes No No No No user/ISP Varnish Gzip on-the-fly compression and decompression Unix All Yes Yes No No No If You want All Ziproxy Images, text & any gzippable data Unix All No No No HTML, JS, CSS Yes Yes ISP
  13. 13. Varnish
  14. 14. SPDY: PageSpeed module Supported platforms: ➔ CentOS/Fedora (32-bit and 64-bit) ➔ Debian/Ubuntu (32-bit and 64-bit) Apache 2.2 and higher Nginx 1.3.15 and higher, for lower versions build from sources
  15. 15. PageSpeed features ➔ Optimizing caching ➔ Minimizing round-trip times ➔ Minimizing request overhead ➔ Minimizing payload size ➔ Optimizing browser rendering ➔ Optimizing for mobile all by filters...
  16. 16. add_instrumentation Adds client-side latency instrumentation Head: window.mod_pagespeed_start = Number(new Date()); End body: pagespeed.addInstrumentationInit('/mod_pagespeed_beacon', 'load', '', 'http://www.modpagespeed.com/add_instrumentation.html');
  17. 17. combine_css
  18. 18. local_storage_cache
  19. 19. resize_mobile_images
  20. 20. And a lot more ➔ collapse_whitespace ➔ combine_javascript ➔ dedup_inlined_images ➔ defer_javascript ➔ extend_cache ➔ extend_cache_pdfs ➔ inline_css ➔ inline_javascript ➔ inline_preview_images ➔ insert_dns_prefetch ➔ move_css_above_scripts ➔ move_css_to_head ➔ lazyload_images ➔ outline_css ➔ outline_javascript ➔ prioritize_critical_css ➔ remove_comments ➔ remove_comments ➔ remove_quotes ➔ resize_rendered_image_dimensions ➔ rewrite_css ➔ rewrite_javascript ➔ rewrite_style_attributes ➔ sprite_images ➔ trim_urls ➔ etc...

×