improving drupal performance

notes from drupalcon 2010 san francisco performance session. whoever led this session (backreference here would be good) -- THANKS. i've already increased a client's site's performance dramatically just by picking and choosing some of the below :)

Drupal Performance tips

iSupportDigital: waterfall diags. faster dropoff is better.

tools/methods (intro):

  • - YSlow
  • - www.webpagetest.org
    waterfall diagrams
    visual rep. of page

    Look at these and decide: is one object killing your performance?

  • (pic)

  • JMeter: java-based load testing tool
  • Apache bench: very simple, very popular, measure reqs/sec
    use. % Ab -n # -c # http://site
    RUN IT, LOVE IT.
    2000 req/sec = magic
  • - Devel Module. "everyone should use it"
  • - Performance module
  • - Page speed module
  • - serve objects from multiple domains (if you have many objects)
  • - CDNs. bring content closer to the edge of the network,
    much faster response and D/L time
    • drupal module: SimpleCDN
    • CDN
    • MediaMover ?
  • "Dramatically increases performance via location and parallel processing"

def'ns.
"Performance" my individual page speed - one person
"Scalability" everyone's page speed - one million people

"Traffic danger zones"
Browser => CDN => Reverse Proxy => App Server => MySQL

As you move to the right through these layers, perfomance
degrades.

Details.

* Performance module.

It's a caching module. Great! Bypass some of your DB access by picking data from the cache.
- Generally leave MIN CACHE LIFE to default, on busy sites:
Longer cache lifetime => Less individual flushing, less cache DB access
- Reduce # of CSS files used

* You can make a full core patch that allows caching-reverse proxy. Advanced step with squid/varnish.

* Cache - Cache Router (?)

* Cache - Memcache module
Very simple
Very fast
Bypass DB caching
Scalable, distributed

* Caching using Boost
- Cache results in files, bypassing PHP+MySQL
- anonymous visitors only
- How? Apache->mod_rewrite checks
if GET:
if Logged_in cookie Does Not Exist:
then serve static

* Back end: PHP accelerator

* Back end: APC (Alternative PHP Cache)
Great stuff, cache compiled PHP
Must check for proper config when you install
A real memory hog
Also check out XCache and eaccelerator

* MySQL caching
Enable MySQL query cache & give it memory
Increase buffer pool

* Note: D7 will be InnoDB. Row-level locking.
BUT MyISAM IS FASTER FOR READS. ^_o

* ALWAYS RUN CRON. (Of course you already do.)