Side Channel

  • home
  • resources
Home › Blogs › angch's blog

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password

Navigation

  • Books
  • Feed aggregator

Recent blog posts

  • Ubuntu mirrors up and improved!
  • Google-jstemplate: Iterate object with unknown properties
  • nginx https proxypass for php apps
  • sugarcrm & memcache: Doing it Wrong
  • subversion and https in Ubuntu Karmic
  • Drupal: Views block delta converted to md5 hash
  • Ubuntu Server install requires PAE
  • Installing Drupal from command line
  • Drupal: Handling form field weight through CCK
  • minify javascript using Google Closure Compiler
more

angch's location

angch twitter

  • angch: Heading to Brunei. Business class for a change.
  • angch: tc qdisc htb activated on the mirror, and mirror reactivated. Hope nothing melts now.
  • angch: Hmmm, tbf doesn't work as advertised. htb does. #qos #linux
  • angch: @yoonkit me thinks #lucid is a much better tag than #lynx
  • angch: Great, you broke the dc's net and they disconnected us. Running to tpm from shah alam
more

Drupal: PostgreSQL vs MySQL

angch's picture

angch — Thu, 26/03/2009 - 19:11

Let's get this out of the way first: MySQL beats PostgreSQL for Drupal sites in terms of raw performance. See this benchmark

But the real question is the how and why, and also how to make sites even faster and more scalable?

I'm not going to address all the possible factors at play here, there are too many of them, so I'm just touching on a number of the whys:

  • Drupal issues a ''lot'' of queries, to the tune of about 100+ queries, including duplicates, per page. Many of these are very simple, name, value lookups, especially checking the links for aliases (aka drupal_lookup_path). The sheer strength and speed of MySQL and it's query caching means it wins over PostgreSQL hands down.

  • Drupal doesn't really do transactions, and uses lock/unlock tables to force consistency across concurrent requests. One "unlock" request forces a COMMIT sql for PostgreSQL. In default installations, this means an fsync() is issued, and fsync on the default installation of Linux's ext3 is rather conservative. Their (ext3, postgreSQL) priority of safety over performance hurts drupal a lot. (Hint: ''default'' settings. synchronous_commit = off helps)

Now, why would anyone want to use PostgreSQL for drupal? Well, because we '''can''', and because I'm a diehard PostgreSQL user, and we believe in safe data. And we have several custom applications built on top of and integrated with Drupal (and we really want Postgis). It is working within the constrain of "must use PostgreSQL" that we have started to be able to track down some performance bottlenecks and getting insights in making things faster, particularly via our own distribution of Drupal, pulut.

  • drupal
  • mysql
  • performance
  • postgresql
  • angch's blog
  • Add new comment


Creative Commons License

  • home
  • resources

Standard Disclaimer.