If I am not mistaken, the openmaptiles/postgis container does not offer any option to change the settings of the database.
So the question is if it would make sense to make some settings configurable. For example as shown in these slides by Frederik from Geofabrik, tuning some settings like increasing RAM usage of postgres can improve render performance. So if one has a bit of memory to spare to increase the memory of the postgres instance.
I you think this is a good idea we could think about how to do this and I could see if I can provide a PR for this.
Please, prepare a PR and we can review the changes.
I think we first have to think about how to do this, before rushing into any PRs :).
I had a look at how Postgis and Postgres recommend to do this.
Apparently, there is the option to use so called ALTER SYSTEM commands.
See:
https://postgis.net/docs/manual-2.5/performance_tips.html#database_tuning_configuration
https://www.postgresql.org/docs/current/static/sql-altersystem.html
This sounds like the way to go. We could think about passing relevant settings via the docker-compose file? It looks like we could pass several values as a list of options and use the ALTER SYSTEM command in the initdb-postgis.sh script.
WDYT? Does this sound reasonable or would you do this differently? Maybe we might need to restart the postgis DB in the process for settings that require a restart, not sure if this is possible via the init script?
https://gist.github.com/smellman/559f74158447c60ebc88c8bc12ebb505
I do it our configuration.
Most helpful comment
https://gist.github.com/smellman/559f74158447c60ebc88c8bc12ebb505
I do it our configuration.