High CPU usage / OCI runtime errors (and more) on self-hosted deployment startup
Hello dear colleagues,
since hours, Bitwarden installation/startup on my Bionic server fails for some reason (never worked thus far). No other daemons like apache2 are listening on the same ports, everything is ran as sudo and followed by Bitwarden/Docker official docs. Resources with not much running should be sufficient (4GB RAM, 2 vCores, 100GB SSD of which 7% is used). 80 and 443 are open of course and URL is correct. All packages are up-to-date.
Still hard to sense a pattern here, especially since I'm also getting "resource not available" bash-errors after some while, i.e. retrying without rebooting the server. It's never able to create all containers.
Terminal logs of a whole from-scratch installation (including Docker): https://gist.github.com/ceeazy/41fb2c3c71eb9c4b8c7372e6f6d2d947
Gonna test in a local VM (/Docker Windows?) later in the morning, anyone got an idea still? Appreciate any help I can get!
Best regards, ceeazy
Can you run any docker containers? What about the simple hello-world container?
Hey Kyle, thanks for taking your time! hello-world runs absolutely fine.
OK, update on this:
Turns out this happened due to insufficient resources on the server. Although was sure I was ordering the hardware as stated above, seems like back then when I ordered the server my provider only offered 1 vCore instead of two and has since then updated their product lineup, hence my confusion in comparison. So PEBKAC after all, as expected. :P
I'm already changing and migrating my passwords and I'm loving it. Issue closed!
Shewt, not quite done with this:
for some reason, the bitwarden/mssql container is still hammering my VPS like crazy. After a while, it starts clocking in at 125% CPU usage - with 15 hours of CPU time within 19 hours of uptime of the server itself. I disabled healthchecks according to #563, unfortunately to no avail. It does not write a lot to disk though, memory seems fine too. It is not a bootloop of that very container.
Digest of docker stats:
https://gist.github.com/ceeazy/823b94c49fe401e54e0c984826c1cd69
What is going on here?
I have the same issue. My bitwarden-mssql container is periodically (twice a minute or so) goint up to 90% CPU-usage for a couple of seconds.
I'm running my warden in a VM on ESXi, and it's noticable that the fans spins up and down during this burst of CPU-usage. Very annoying!
Yeeeeah, this is still a dangling one for me as well. Gotta check docker logs (--follow) of mssql later when this happens again, I'm just about to start messing around again.
Ironically, this stopped some weeks ago just when I was about to monitor it manually with htop.
But currently I am in the process of setting up everything in Docker containers using jwilder/nginx-proxy & JrCs/docker-letsencrypt-nginx-proxy-companion for my domains which obviously has me unidle and restarting Bitwarden regularly; this just about started to happen again.
Really annoying workflow-wise for me personally since it steals all my resources up to the point where there's literally not enough left to stop containers/Bitwarden at all - only solution is sudo reboot now or even force restart via my VPS provider.
So glad Bitwarden caches data offline!
@Jannibal, you running Bionic as well?
- My self hosted server has only 1 user account
- Yet, with 4GB of RAM, the mssql/
sqlservrfrom Bitwarden docker container causeskswapd0to hit 100% CPU after about 24 hrs - Increasing it to 8GB did not help either
- This is beginning to sound like a memory leak
- How about using mysql instead?
Please test server 1.33.0, as starting with this version, mssql does not have access to public network anymore : in #495, I suspected this public network access to be the culprit of my CPU issues, which has then been properly disabled in https://github.com/bitwarden/server/issues/286#issuecomment-555915360.
@Mart124 thanks but updating caused #586 my container keeps restarting now
@Mart124 after using 1.33.0, the CPU issues remains
Yet, with 4GB of RAM, the mssql/sqlservr from Bitwarden docker container causes kswapd0 to hit 100% CPU after about 24 hrs
@bilogic I would give a try increasing RAM (even if 4GB should be enough), and increasing number of CPU (at least 2). I also faced this swap issue, swap usage keeping increasing, this was a system resources issue.
@Mart124 I have 4 CPUs and 8GB allocated, and it serves only 1 user, me.
Hey guys!
Glad this gets some attention. In the meantime I just switched to bitwarden_rs. @bilogic reminded me of mentioning that I'm the only user of my vault as well.
I'm pretty sure this issue is related to #646
and #534
The server uses an incredible amount of resources after just 19 hours...
I restarted bitwarden by restarting docker 3 hours ago after my last post... it got right back to hogging up all resources
+1 here. Slef hosted, single user. 4gb memory chewed up and a heap of cpu cycles. Been this way for many months now.
@0x646e78
I ended up using https://github.com/dani-garcia/bitwarden_rs and has been good since. I'm not sure how they did it, but the UI etc is the same as this repo.
Hi @ceeazy, We're cleaning up our repositories in preparation for a major reorganization. Issues from last year will be marked as stale and closed after two weeks. If you still need help, comment to let us know and we'll look into it. Thanks!