-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add some performance-related environment variables #320
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
Comments
Any reason you can't just use $ docker run -it --rm postgres -c work_mem=8MB
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
****************************************************
WARNING: No password has been set for the database.
This will allow anyone with access to the
Postgres port to access your database. In
Docker's default configuration, this is
effectively any other container on the same
system.
Use "-e POSTGRES_PASSWORD=password" to set
it in "docker run".
****************************************************
waiting for server to start....LOG: could not bind IPv6 socket: Cannot assign requested address
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: database system was shut down at 2017-07-28 00:51:24 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
done
server started
ALTER ROLE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
LOG: received fast shutdown request
waiting for server to shut down....LOG: aborting any active transactions
LOG: autovacuum launcher shutting down
LOG: shutting down
LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
LOG: database system was shut down at 2017-07-28 00:51:26 UTC
LOG: MultiXact member wraparound protections are now enabled
LOG: database system is ready to accept connections
LOG: autovacuum launcher started $ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9c2a125537ef postgres "docker-entrypoint..." 8 seconds ago Up 7 seconds 5432/tcp frosty_ride
$ docker exec -it frosty_ride psql -U postgres
psql (9.6.2)
Type "help" for help.
postgres=# SHOW work_mem
postgres-# ;
work_mem
----------
8MB
(1 row)
|
Yes, I want to make it user-friendly for people that are not familiar with database and Docker configuration (gravitystorm/openstreetmap-carto#2698). The problem is that if I want to use such variables and they are not defined, Postgres fails ( |
I think tianon's solution is fine, as long as it's in the official documentation (which it isn't, as far as I know) |
Closed via docker-library/docs#1095 |
I think it would be good to have some basic performance-related environment variables available out of the box to make it more suitable for real-life cases. I'm interested in something like
POSTGRES_WORK_MEM
andPOSTGRES_MAINTENANCE_WORK_MEM
, because that's what should be enough for OpenStreetMap data importing into Docker-enabled environment.The text was updated successfully, but these errors were encountered: