convex-backend icon indicating copy to clipboard operation
convex-backend copied to clipboard

Mention recommended minimum CPU and Memory requirements for self-hosting

Open xixixao opened this issue 3 months ago • 5 comments

Ideally this README: https://github.com/get-convex/convex-backend/tree/main/self-hosted should mention what is the minimum amount of memory and CPU cores/etc. needed to run the default backend configuration.

My current conservative kube limits:

resources:
  requests:
    memory: "4Gi"
    cpu: "500m"
  limits:
    memory: "6Gi"
    cpu: "4000m"

xixixao avatar Sep 18 '25 08:09 xixixao

I'm curious to know how much ram does the backend use with low traffic or close to idle

lennon03 avatar Sep 23 '25 08:09 lennon03

yep - it's a good idea.

There is no one size fits all answer Your mileage may vary, so you can only really get a true answer by trying out your own workload. CPU you can go as low or high as you want depending on your load. Memory has some baseline usage, but increases again with your load.

Here's a screenshot after I do docker compose up and look at my docker dashboard.

Image Image

nipunn1313 avatar Sep 25 '25 23:09 nipunn1313

if one of you wants to show usage on your project and post in this thread - that'll help future folks with similar questions.

nipunn1313 avatar Sep 25 '25 23:09 nipunn1313

running docker stats on a self hosted instance with like 5-10 tables in it and 5-10 rows total across all tables

❯ docker stats --no-stream 
CONTAINER ID   NAME               CPU %     MEM USAGE / LIMIT     MEM %     NET I/O   BLOCK I/O         PIDS
6cb4d74f0a87   convex-backend     2.48%     224.5MiB / 22.29GiB   0.98%     0B / 0B   1.43MB / 35.4MB   43
9632dea354bb   convex-dashboard   0.00%     52.79MiB / 22.29GiB   0.23%     0B / 0B   1.36MB / 0B       11

docker compose

  • 225 MB for backend
  • 52 MB for frontend

So I would say 300 MB to get started from fresh

adaptive-shield-matrix avatar Nov 21 '25 07:11 adaptive-shield-matrix

I find it a bit strange that Convex needs 225 MB of memory to run, since its written in Rust and should be very memory efficient. Running Bun (supporting a much more inefficient JS runtime) with websockets and some http routing eats about 100 MB. Very strange seeing Convex use more, or am I the only one?

adaptive-shield-matrix avatar Nov 21 '25 07:11 adaptive-shield-matrix