You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed a constant memory growth of the container holding Caddy server in our production environment. We used Caddy as a reverse proxy only and recently started using it as a cache for HTTP requests. Since that moment we see constant growth of memory in the Caddy server under the same load. In 3-4 days the app memory usage grows from 500-700MB to 5GB+
I also provided a way to reproduce this issue locally https://github.com/andriimredocly/caddy-possible-memory-leak.
It consists of a Caddy server with a minimal possible config for reverse proxying and caching. The upstream web server is just a Nginx application that responds with the same simple HTML and cache headers to all requests. The Redis container is also deployed to store the cached responses.
The tool to emulate the load is wrk (https://github.com/wg/wrk) a popular open-source tool to do the load testing. The lua script generates unique URLs for each request. Maybe because each request has a unique URL - some data is stored in Caddy server memory, but this does not sound like an expected behavior.
Resources usage from locally launched application
When the cache is disabled, the memory remains consistently low (<100MB), so this clearly indicates an issue with the cache-handler.
The text was updated successfully, but these errors were encountered:
I noticed a constant memory growth of the container holding Caddy server in our production environment. We used Caddy as a reverse proxy only and recently started using it as a cache for HTTP requests. Since that moment we see constant growth of memory in the Caddy server under the same load. In 3-4 days the app memory usage grows from 500-700MB to 5GB+
I also provided a way to reproduce this issue locally https://github.com/andriimredocly/caddy-possible-memory-leak.
It consists of a Caddy server with a minimal possible config for reverse proxying and caching. The upstream web server is just a Nginx application that responds with the same simple HTML and cache headers to all requests. The Redis container is also deployed to store the cached responses.
The tool to emulate the load is wrk (https://github.com/wg/wrk) a popular open-source tool to do the load testing. The lua script generates unique URLs for each request. Maybe because each request has a unique URL - some data is stored in Caddy server memory, but this does not sound like an expected behavior.
Resources usage from locally launched application
When the cache is disabled, the memory remains consistently low (<100MB), so this clearly indicates an issue with the cache-handler.
The text was updated successfully, but these errors were encountered: