search results page can decrease traffic and ad revenues by 20 percent, according to a Google study. • Amazon found that every additional 100 milliseconds of load time decreased sales by 1 percent http://www.websiteoptimization.com/speed/tweak/psychology-web-performance/
(prevents hard drive swap space usage) (Total Memory - Operating System Memory - MySQL memory) / Size Per Apache process 4096MB - 512MB - 2048MB / 100MB = 15 Max-Clients
Wizard = Great Start! (https: //tools.percona.com/wizard) • Use Innodb (this is the default for D7) • Increase Innodb Buffer Size • MySQL Query Cache • Check your slow query logs!
from having to load the PHP files from the hard drive. It saves them in memory instead (much faster) http://linuxaria.com/howto/everything-you-need-to-know-about-apc-alternate-php-cache?lang=en
apc.php Download this from http://pecl.php.net/package/APC apc.shm_size = 64M apc.include_once_override = 1 http://2bits.com/articles/high-php-execution-times-drupal-and-tuning-apc-includeonce-performance. html
Drupal's Performance Admin Cache pages for anonymous users: Stores entire HTML in cache db table (or memcached/redis). Also, enables external caching (Varnish, Browser). Cache Blocks: Basic caching for blocks. Note that blocks created by views must be explicitly enabled for caching. Amount of time before page cache is cleared. Note! This needs to be enabled for Block Cache! Uses PHP library to Gzip html. KEEP THESE CHECKED DAMNIT! :) Only affects external caches (Varnish, browers). Sets cache-control max-age value.
set time period (does what you think it does). Rendered Output Cache: Does not cache db query. This will query the db (or query results cache), and if there is no change it will output rendered html. If there *is* a change, it will regenerate and cache resulting html.
http://drupal.org/project/boost Does what Varnish does - but doesn't require external service. This will work on most shared hosts and can dramatically speed up anonymous page requests! (Plus it has 26 essential vitamins & minerals!)
http://drupal.org/project/authcache After a page is loaded by the browser, a second HTTP request may be performed via Ajax. This initiates a lightweight DRUPAL_BOOTSTRAP_ SESSION that allows SQL queries to be executed, and returns any user-customized data to the page .
http://drupal.org/project/entitycache Useful ONLY for large site with lots of fields and references your entity types. Mostly useful for scalability. Good discussion at http://groups.drupal.org/node/292348
http://drupal.org/project/imageapi_optimize Losslessly optimizes an image when it is saved. ◦ Supports 3rd party services. ◦ Integrates into D7 core's image styles.
◦ Query Log ◦ XHProf support (must have XHProf installed on server) ◦ Page Timer ◦ Memory Usage • Performance Logging and Monitoring http://drupal.org/project/performance ◦ Enables awesome performance logs ◦ Can log directly to DB - only do this on dev sites ◦ On live sites can log to cache services (memcache, apc, etc)
one not made." - Chris Coyier • Modern Browsers are limited to 6 parallel connections (per server) • Design and Theme your website with HTTP Requests in mind • CSS Image Sprites • Inline Images (Base64 encoding) • Icon Fonts
background images into one image. • Use CSS's background-position property to move the background image into correct placement • PITA (but worth it) • Sass & Compass do it for free! (YA- AAAYYY!!) http://compass-style.org/reference/compass/ helpers/sprites/
an HTTP Request! :) • But, it makes your CSS or HTML file longer :( • Unless... you make sure the files are being compressed by your web server. The total size will (about) even out in the end! :) • But, its a PITA ...you have to upload your image to a website that converts it. :( • Unless... you use Sass/Compass! inline-image("../images/background-pattern.png") :)
HTTP requests per server ◦ Use Google CDN for Jquery! Its free and browser may already have it cached! https://github.com/mherchel/bastard/blob/master/template.php template.php
Delivery Network! CDNs can spread assets across multiple servers: static1.yourcdn.com static2.yourcdn.com ... Also, CDNs can serve assets from locations that are physically closer to you. This is a huge win in the war against latency! THE ASSETS! CDN ALL
static assets! • Make sure static assets are able to be cached by your browser! • Optimize your images! (use that image api optimizer module or do it manually) ◦ Use JPGs instead of PNGs when you can • Don't use a lot of images! ◦ Don't load unnecessary images in mobile css (progressive enhancement)
will follow. - Lara Swanson at http://alistapart.com/article/improving-ux- through-front-end-performance • Not so easy to do in Drupal! So, here's some easy tips: ◦ Create or use a minimal base theme. Don't get stuck with unnecessary wrapper elements (Looking at you Omega!). ◦ Modify Views to output semantic HTML Elements ◦ Or use the Fences Module! http://drupal. org/project/fences
to as little as possible • Don't use elements as selectors. Use IDs or classes instead. • This is baaaadd... • Use Instead of • Limit CSS3 selectors (:nth-child(), :last-child, etc) http://css-tricks.com/efficiently-rendering-css/
JS execution take approx 10x longer on mobile devices (due to less RAM and CPU) • Async and deferred JS execution - http://www.html5rocks.com/ en/tutorials/async/deferred/ and http://peter.sh/experiments/asynchronous -and-deferred-javascript-execution-explained/ • http://jsperf.com - aims to provide an easy way to create and share test cases, comparing the perform- ance of different JS snippets by running benchmarks.
Guide to Caching Data in Drupal 7 (in code) http://www.lullabot.com/blog/articles/beginners-guide-caching-data-drupal-7 • Top 15 Drupal performance tips http://www.netmagazine.com/features/top-15-drupal-performance-tips • DrupalCon Sydney: Performance Tough Love http://www.youtube.com/watch?v=WoFBAGHvAFA
by Nate Haug (This is awesome) http://drupalize.me/videos/overview-performance-scalability • Every damned thing on 2bits.com http://2bits.com/ • ...including Xen vs Virtuozzo (Cloud computing) http://2bits.com/articles/common-issues-and-solutions-dealing-cloud- computing-and-vps-performance-issues-drupal.html
Souders (Lots of great JS optimization tips) http://stevesouders.com/ • Presentation: Even Faster Websites (Steve Souders) http://www.slideshare.net/souders/sxsw-even-faster-web-sites • Let’s Do Simple Stuff to Make Our Websites Faster (Chris Coyier) http://css-tricks.com/video-screencasts/114-lets-do- simple-stuff-to-make-our-websites-faster/
at http://fldrupalcamp.org/community/after-party • If you're going to DrupalCon Portland, we're doing some hiking beforehand and are looking for more people http://groups.drupal.org/node/288408 • I'm on Twitter at @mikeherchel