Skip to main content

Drupal + CentOS + optimization

I've been working through various optimization issues today and thought i'd share them with my future self and anyone else who reads this.

mod_deflate

I'd heard that getting apache to gzip your non-compressed data was a good idea and thought I was probably already doing that with my default apache2 setup on CentOS 4.4. What I learned was that:
  1. For apache2, the relevant module is mod_deflate (it used to be mod_gzip)
  2. My CentOS included the apache module by default, but didn't enable it. I did that according to the excellent documentation on the apache web site.
  3. I found a test site, which says that the html is now about 25% of what it was, saving me bandwidth and increasing the apparent response of my sites.

wim leers

I found a great article about drupal optimization here: improving drupal's page loading performance. He refers to a firefox plug-in developed by Yahoo that looks like a great tool, as well as a list of key issues to analyse for any site, and how those can be addressed in various ways by Drupal. My key understanding here is that php code + mysql optimization is only a small part of the user experience of a fast site.

APC + mysql query cache

Yes, I use APC as my php cache and love it. And i've tuned mysql somewhat to have a reasonable query cache. For handling sudden bursts of traffic (e.g. gpo.ca during the election), this combination is awesome - it means most traffic, even for complex pages, is handled by a bare minimum of cached php and cache mysql calls. Great for the server scaling traffic anyway.

css + javascript

Wim's article above refers to this issue, but it's worth thinking about on it's own. I'd like to use the javascript compressor for all my custom and contrib module javascript and stick it at the end of the page html. And using Drupal's built in css combine/compress mechanism seems more important now - i'd been ignoring it.

apache2

The default apache2 setup for CentOS isn't optimized for Drupal - it comes with a lot of extra modules. I haven't done a rigourous paring yet, but would like to report on what I can remove when i do eventually manage that. Also - i'd like to consider having separate apache instances for https and civicrm so that it's more streamlined. I'm also using fastcgi for sympa, which would be nice to split out.

Popular posts from this blog

The Tyee: Bricolage and Drupal Integration

The Tyee is a site I've been involved with since 2006 when I wrote the first, 4.7 version of a Drupal module to integrate Drupal content into a static site that was being generated from bricolage. About a year ago, I met with Dawn Buie and Phillip Smith and we mapped out a number of ways to improve the Drupal integration on the site, including upgrading the Drupal to version 5 from 4.7. Various parts of that grand plan have been slowly incorporated into the site, but as of next week, there'll be a big leap forward that coincides with a new design [implemented in Bricolage by David Wheeler who wrote and maintains Bricolage] as well as a new Drupal release of the Bricolage integration module . Plans Application integration is tricky, and my first time round had quite a few issues. Here's a list of the improvements in the latest version: File space separation. Before, Drupal was installed in the apache document root, which is where bricolage was publishing it's co...

A Strange Passion for Security

I'm not a computer security expert, but it's been part of my work for many years, in different forms.  A very long time ago, a friend hired me to write up a primer for internet security, and ever since then it's been a theme that's sat in the background and pops up every now and then . But lately, it's started to feel like more than a theme, and but indeed a passion. You may consider computer and internet security to be a dry subject, or maybe you imagine feelings of smugness or righteousness, but "passion" is the right word for what I'm feeling. Here's google's definition: Passion: 1. a strong and barely controllable emotion. 2. the suffering and death of Jesus. Okay, let's just go with number 1. for now. If you followed my link above to other posts about security, you'll notice one from eight years ago where I mused on the possibility of the discovery of a flaw in how https works. Weirdly enough, a flaw in https was discovered shortly...

Orchestrating Drupal + CiviCRM containers into a working site: describing the challenge

In my previous posts, I've provided my rationale for making use of Docker and the microservices model for a boutique-sized Drupal + CiviCRM hosting service. I've also described how to build and maintain images that could be used for the web server (micro) service part of such a service. The other essential microservice for a Drupal + CiviCRM website is a database, and fortunately, that's reasonably standard. Here's a project that minimally tweaks the canonical Mariadb container by adding some small configuration bits:  https://github.com/BlackflySolutions/mariadb That leaves us now with the problem of "orchestration", i.e. how would you launch a collection of such containers that would serve a bunch of Drupal + CiviCRM sites. More interestingly, can we serve them in the real world, over time, in a way that is sustainable? i.e. handle code updates, OS updates, backups, monitoring, etc? Not to mention the various crons that need to run, and how about things ...