koyeb / koyeb-cli

Koyeb cli
Apache License 2.0
56 stars 29 forks source link

Memory inconsistencies in docker deployments #213

Closed fabio-nettis closed 4 months ago

fabio-nettis commented 5 months ago

Describe the issue

Our application over at @hellhub-collective/api is deployed to koyeb via a docker container and encounters wierd memory usage inconsistencies when deployed to production.

deployment metrics dashboard

As you can see, the memory usage just climbs slowly over the span of hours (sometimes days), until the cap is reached and the container is shut down. We have simulated the current production request throughput and let the API run on a machine for 2 days straight and our docker container runs just fine without any memory usage inconsistencies when span-up locally.

Expected behavior

The should not be any difference between the deployment and development behaviors, since it is the same dockerfile for both stages.

How to reproduce

  1. Clone our repository and run it locally as docker container using the following command: docker build --pull -t "hellhub-collective/api" . && docker run -d -p 3000:3000 "hellhub-collective/api"

  2. Monitory the memory usage and compare it to an instance deployed to koyeb.

  3. See inconsistencies

fabio-nettis commented 5 months ago

PS: This might not be the righ repository to raise this concern, but it was not quite clear to me where I can get support for a platform issue.

bchatelard commented 4 months ago

Hey,

Yes this is usually reserved to issues for the koyeb cli.

We usually recommend posting a message here: https://community.koyeb.com/

For your issue, I looked quickly and I'm not able to reproduce using: koyeb/demo for example.

Here is a display of 7d where memory is flat.

Screenshot 2024-05-07 at 11 45 28

I would recommend to add some utils in your image so you can inspect where the memory is used.