[katello-devel] How to speed-up unit tests (again)

Ivan Nečas inecas at redhat.com
Mon Oct 24 13:54:09 UTC 2011


On 10/24/2011 03:32 PM, Lukas Zapletal wrote:
> Hey,
>
> since we started using PostgreSQL for our unit tests I did some 
> quick-googling today and found this postgresql.conf setting:
>
> # tail /var/lib/pgsql/data/postgresql.conf
> fsync=off
> synchronous_commit=off
> full_page_writes=off
> bgwriter_lru_maxpages=0
>
> Those four lines will set your database instance to highly 
> asynchronous mode, that means everything is much faster (no 
> synchronized hdd writes - my hdd LED literally does not blink during 
> whole test). While this improves database performance a lot, it can 
> cause loss of data in case of power outage. Please DO NOT use this for 
> production systems :-)
>
> I did not do any measurements but unit test run is notable faster. 
> Feel free to share your numbers.
>
Cool.
This is output from my testing:

*Without this settings:*
1075 examples, 0 failures, 20 pending

real    4m35.818s
user    3m29.188s
sys    0m7.560s

one spec file:
real    0m18.987s
user    0m10.995s
sys    0m1.894s

*
With this settings:*
real    4m39.068s
user    3m34.858s
sys    0m7.772s

one spec file:
real    0m14.200s
user    0m10.897s
sys    0m1.893s


It's faster when running few tests (e.g. a single spec file) - faster 
preparation of the database. There is no difference for the whole test 
suite. However, this measurement doesn't include the saving of the disk.

-- Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/katello-devel/attachments/20111024/8ac2d942/attachment.htm>


More information about the katello-devel mailing list