[development] drupal on postgresql benchmark

Bill Moran wmoran at potentialtech.com
Mon Nov 26 18:36:28 UTC 2007


In response to "Khalid Baheyeldin" <kb at 2bits.com>:

> Well, I did some benchmarks, and they show that, out of the box at least,
> MySQL is faster.

Unfortunately, that really doesn't mean anything.

I don't know about the configs that ship with Ubuntu, but the
PGDG configs produce lousy performance.  It's a known factor
that the default configs are not tuned for performance and
actually perform pretty badly.

Based on your "Future considerations" section, if you send me
the specs for the hardware this is running, and a copy of
the postgresql.conf file, I'll send you a tweaked file to
retest with.

There is, however a chance that PostgreSQL simply isn't going
to run as fast as MySQL.  This is, in part, because Drupal is
written (primarily) by MySQL people.  I'm willing to bet that
most of them don't even know when they're taking advantage of
things in MySQL that are unusually fast (MySQL, for example is
faster at executing simply SELECT queries than anything else
out there, whereas PostgreSQL is faster at complex joins ...
if Drupal fetches related data from 5 tables in five separate
SELECTS instead of 1 big SELECT with a bunch of joins, then it
will always be faster on MySQL).

In any event, once you've run the tests, I'd like a copy of
your PostgreSQL query log, which I can then analyze to see if
there's any way to improve speed.  Hopefully there will be
ways to optimize queries that doesn't hurt MySQL's performance.

I have one additional question.  You say the following:
"MySQL's query cache makes its performance better. This can be demonstrated by restarting MySQL, then visiting the home page of the site and seeing the query time in devel's output. However this is not as marked as what PostgreSQL takes."

Could you explain/clarify that statement?

-- 
Bill Moran
http://www.potentialtech.com


More information about the development mailing list