-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
I'm working on a branch to move from node to bun as our runtime. The docker container builds successfully, and on the surface the service seems to run without any errors. However, we're seeing very high memory & CPU usage after deploying the service onto GKE, which quickly leads to a service restart. No errors are being emitted, and the service seems responsive when it's running.
Services use about ~500MB of memory when running on node, but the memory quickly spikes to the container limit of ~1.2GB when running on bun.
Note: We have been using bun to run these same services locally on MacOS for over a year without any issues.
I've attached a screenshot of our CPU / Memory usage during the bun deployment. The only thing that changed in that time is two lines in the Dockerfile, image also attached.
Note that the image shows us running CMD [ "bun", "--max-old-space-size=4096", "--enable-source-maps", "./index.js"], I removed the source maps and max-old-space-size args in one test and it didn't fix the issue.
More context about our setup
- We build a single JS file using
nccfor each service - Service is built as a docker container and deployed onto GKE
- I tried the deployment both with the
oven/bun:alpineimage and also our usualnode:alpineimage with bun installed separately. No difference. - bun version used: 1.2.2 (I also tried 1.2.4 but I get a segfault on startup)
At this point this is the only reason we can't fully migrate to bun, so any insight would be appreciated.

