How can I lower Ecto repository connection costs for a low‑traffic workload?
0 reputation · 07 Jul 2020, 05:55 UTC
For a low‑traffic application I want to keep the Ecto repository’s resource usage minimal while still answering requests promptly. The repository creates connection pools that can consume memory and database slots even when idle, and features such as query caching or detailed logging add overhead that may be unnecessary for infrequent workloads. I am considering adjusting pooling, caching, logging, and timeout settings to reduce cost, but I am unsure how these options interact under light load and whether lowering them could affect latency or reliability.
What is the impact of setting pool_size to 1 and pool_count to 1 on connection usage? Does disabling :query_cache save memory without hurting performance for rare queries? Is it safe to turn off :log to cut logging overhead in production?