-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possibility to run containers with fsync=off #1256
Comments
Sounds interesting.
Btw. you can already use the Testcontainers Postgres module with tempfs (
https://docs.docker.com/storage/tmpfs/), which might provide the same speed
boost.
Alexander Kjäll <notifications@github.com> schrieb am Di., 19. Feb. 2019,
20:24:
… According to this article:
https://pythonspeed.com/articles/faster-db-tests/ a lot of speed can be
gained when running postgresql in docker with fsync=off.
When I look at the docker image that testcontainers start with "docker
inspect" it doesn't seem to run it with fsync off, and I have tried to play
around with the .withCommand() and .addEnv() functions without success.
Is there a recommended way to set -c fsync=off in the docker run command?
If yes, could this maybe be a bit better exposed?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1256>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AE2jaNJJeCGIjK57JOHamlckL5O7XhW3ks5vPE-GgaJpZM4bDsJY>
.
|
That was a good suggestion, setting tmpfs to "/var/lib/postgresql/data" moved my heaviest tests from taking roughly 17 seconds to 3 seconds and the whole testsuite from about 90 seconds to 60 seconds. |
Whoa! Nice, we should set it by default!
Perhaps you want to contribute? 🤞
…On Tue, 19 Feb 2019 at 22:23, Alexander Kjäll ***@***.***> wrote:
That was a good suggestion, setting tmpfs to "/var/lib/postgresql/data"
moved my heaviest tests from taking roughly 17 seconds to 3 seconds and the
whole testsuite from about 90 seconds to 60 seconds.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1256 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAIimgnCOjhIfo3erjlGbGNnDirfER7ks5vPGtKgaJpZM4bDsJY>
.
|
Sure, I'll try to write a pull request tomorrow or the day after. |
@bsideup I looked at creating a pull request yesterday, but I'm not really friends with gradle and the testsuite completely hosed my old laptop, but it looked like it might just be a one line change. I'm sorry to say that someone else needs to create the pull request, I don't have enough free time to do it and do it well. |
Releasing this in 1.11.0 🎉 |
- added options to specify postgres database configuration for databaseName, username and password, which can now be defined when instantiating a new container - added configuration option mountPostgresDataToTmpfs, which allows to mount the postgres data directory (/var/lib/postgresql/data) inside the docker container to an in-memory volume for improved performance (see testcontainers/testcontainers-java#1256)
* Adding more configuration options to PostgresSQLContainer - added options to specify postgres database configuration for databaseName, username and password, which can now be defined when instantiating a new container - added configuration option mountPostgresDataToTmpfs, which allows to mount the postgres data directory (/var/lib/postgresql/data) inside the docker container to an in-memory volume for improved performance (see testcontainers/testcontainers-java#1256) * - removed dangling colon in apply() function
According to this article: https://pythonspeed.com/articles/faster-db-tests/ a lot of speed can be gained when running postgresql in docker with fsync=off.
When I look at the docker image that testcontainers start with "docker inspect" it doesn't seem to run it with fsync off, and I have tried to play around with the .withCommand() and .addEnv() functions without success.
Is there a recommended way to set -c fsync=off in the docker run command? If yes, could this maybe be a bit better exposed?
The text was updated successfully, but these errors were encountered: