4 ms·
I may be naive, but do people with slow DB tests put the DB in a tmpfs to improve performance?
by rmetzler 6y ago
I may be naive, but do people with slow DB tests put the DB in a tmpfs to improve performance?
- sverhagen 6y agoFor integration testing I'm sure people do all sorts of "interesting" things. For unit tests in an automated CI build, it is often more desirable to have a smaller subset of data, which presumably is less slow, since tests there also focus on more isolated workflows.
- mixedCase 6y agoI have used libeatmydata to help with this, but you just made me realize that in my current project I could just dump the test db to RAM. Thanks for the tip!
- tarjei 6y agoWe do this all the time. Our tests run against SQLite (I use Mariadb in prod). Each parallel testrun gets its own path in /dev/shm/xx so everything is in ram as well.
- ptx 6y agoIf you're using SQLite, why the indirection of an in-memory filesystem rather than SQLite's in-memory database feature?
- yencabulator 6y agoNot the person you're asking this, but N connections to sqlite :memory: backend results in N separate database instances. This can be worked around in some scenarios, but not always & reliably. Most importantly, you can't reach the same in-memory database from multiple processes. https://www.sqlite.org/inmemorydb.html https://www.sqlite.org/inmemorydb.html