I’ve made RSpec test suite for my Ruby on Rails application 18% faster by following a Non-durable PostgreSQL configuration guide.
When I’m developing (usually Ruby on Rails) applications using PostgreSQL database server for persistence, I don’t need high durability of my development database (or integration server). What I care the most is it’s speed. I realize, however, that database server, probably, is not the bottle neck of the typical application test suite.
Here I show how switching few options in the PostgreSQL config file increased performance of the test suite on my development machine (by reducing durability).
Disclaimer: I’m not performance testing ninja and all my performance tests are very subjective. I test only what I care the most – execution time of the test suite for my current Ruby on Rails application.
Hardware: Intel i7-3720QM CPU @ 2.60GHz, 16 Gb RAM OS: Ubuntu 12.04.3 LTS Software: Ruby on Rails 3.2.15, Ruby 2.0.0p247, Postgres 9.2.5
About the application
Default PostgreSQL 9.2.5 configuration
Here are results of running full test suite on the clean PostgreSQL installation:
Or about 295 seconds in average.
According to the official Non-durable configuration guide, I modified my
/etc/postgresql/9.2/main/postgresql.conf in the following way:
Or about 243 seconds in average, with more intensive CPU usage.
As we can see, very simple configuration change made execution of my test suite ~52 seconds (or ~18%) faster, which is pretty nice, I think.postgres rails