Process bitward+ biggest consumer of resources most of the time

Not really a problem, but still curious why bitwarden runnung sqlservr uses the most resources when I do a ‘top’.

Just had another look. 24GB of memory seems a bit excessive.
And there are 2 more bitward+ dtnet processes also using 20GB+

Hi @poldi,

24GB of memory definitely seems a bit high, how many active users do you have using your self-hosted instance?

Have you looked into the Bitwarden Unified Beta?

It is a new unified project that brings the Bitwarden resources into a single image, along with a BYOD (Bring Your Own Database) style design.
Currently it offers quite a few benefits, along side being easier to manage a single docker instance, the Unified image allows for multiple database types, support for ARM architecture type CPUs, and a much more lightweight resource requirement.


Note: Though I would caution it is still a beta project, so if needed for a production use case you may not wish to run this.

Sorry, I should have been clearer.

I’m running a docker install on Ubuntu 20.04.5 LTS (Focal Fossa) and have just updated/upgraded bitwarden.

I have not tried the Unified Beta (yet)

That’s really excessive. I have an instance running on the same version of Linux and I don’t think docker and the the BW stack use more than 1 GB total.

Have you checked the logs to see what’s going on?

docker logs bitwarden-mssql 

docker exec -it bitwarden-mssql more /var/opt/mssql/log/errorlog

docker logs bitwarden-mssql

2022-12-26 00:02:27.54 Server      The licensing PID was successfully processed. The new edition is [Express Edition].^M
^M2022-12-26 00:02:27.87 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.mdf' to '/var/opt/mssql/data/model_replicatedmaster.mdf'.^M
^M2022-12-26 00:02:27.91 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_replicatedmaster.ldf' to '/var/opt/mssql/data/model_replicatedmaster.ldf'.^M
^M2022-12-26 00:02:27.92 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_msdbdata.mdf' to '/var/opt/mssql/data/model_msdbdata.mdf'.^M
^M2022-12-26 00:02:28.03 Server      Setup step is FORCE copying system data file 'C:\templatedata\model_msdblog.ldf' to '/var/opt/mssql/data/model_msdblog.ldf'.^M
^M2022-12-26 00:02:28.20 Server      Microsoft SQL Server 2019 (RTM-CU17) (KB5016394) - 15.0.4249.2 (X64) ^M
^M      Jul 22 2022 12:11:33 ^M
^M      Copyright (C) 2019 Microsoft Corporation^M
^M      Express Edition (64-bit) on Linux (Ubuntu 20.04.4 LTS) <X64>^M
^M2022-12-26 00:02:28.21 Server      UTC adjustment: 0:00^M
^M2022-12-26 00:02:28.21 Server      (c) Microsoft Corporation.^M
^M2022-12-26 00:02:28.21 Server      All rights reserved.^M
^M2022-12-26 00:02:28.21 Server      Server process ID is 392.^M
^M2022-12-26 00:02:28.21 Server      Logging SQL Server messages in file '/var/opt/mssql/log/errorlog'.^M
^M2022-12-26 00:02:28.21 Server      Registry startup parameters: ^M
^M       -d /var/opt/mssql/data/master.mdf^M
^M       -l /var/opt/mssql/data/mastlog.ldf^M
^M       -e /var/opt/mssql/log/errorlog^M
^M2022-12-26 00:02:28.22 Server      SQL Server detected 1 sockets with 8 cores per socket and 8 logical processors per socket, 8 total logical processors; using 4 logical processors based on SQL Server licensing. This is an informational message; no user action is required.^M
^M2022-12-26 00:02:28.23 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:28.23 Server      Detected 24077 MB of RAM. This is an informational message; no user action is required.^M
^M2022-12-26 00:02:28.23 Server      Using conventional memory in the memory manager.^M
^M2022-12-26 00:02:28.23 Server      Page exclusion bitmap is enabled.^M
^M2022-12-26 00:02:28.38 Server      Buffer pool extension is not supported on Linux platform.^M
^M2022-12-26 00:02:28.39 Server      Buffer Pool: Allocating 4194304 bytes for 3768320 hashPages.^M
^M2022-12-26 00:02:28.79 Server      Buffer pool extension is already disabled. No action is necessary.^M
^M2022-12-26 00:02:29.31 Server      Successfully initialized the TLS configuration. Allowed TLS protocol versions are ['1.0 1.1 1.2']. Allowed TLS ciphers are ['ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:!DHE-RSA-AES256-GCM-SHA384:!DHE-RSA-AES128-GCM-SHA256:!DHE-RSA-AES256-SHA:!DHE-RSA-AES128-SHA'].^M
^M2022-12-26 00:02:29.38 Server      Query Store settings initialized with enabled = 1, ^M
^M2022-12-26 00:02:29.42 Server      The maximum number of dedicated administrator connections for this instance is '1'^M
^M2022-12-26 00:02:29.45 Server      Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:29.93 Server      Using dynamic lock allocation.  Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node.  This is an informational message only.  No user action is required.^M
^M2022-12-26 00:02:29.98 Server      In-Memory OLTP initialized on lowend machine.^M
^M2022-12-26 00:02:30.13 Server      [INFO] Created Extended Events session 'hkenginexesession'^M
^M2022-12-26 00:02:30.13 Server      Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.^M
^MForceFlush is enabled for this instance.
^M2022-12-26 00:02:30.21 Server      Total Log Writer threads: 2. This is an informational message; no user action is required.^M
^M2022-12-26 00:02:30.31 Server      clflush is selected for pmem flush operation.^M
^M2022-12-26 00:02:30.31 Server      Software Usage Metrics is disabled.^M
^M2022-12-26 00:02:30.36 spid11s     [1]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.^M
^M2022-12-26 00:02:30.36 spid11s     Starting up database 'master'.^M
^M2022-12-26 00:02:30.38 Server      CLR version v4.0.30319 loaded.^M
^MForceFlush feature is enabled for log durability.
^M2022-12-26 00:02:30.48 spid11s     RecoveryUnit::InitPersistentVersionStore failed with db [1] name [master]^M
^M2022-12-26 00:02:30.48 spid11s     RecoveryUnit::InitPersistentVersionStore failed with db [1] name [master]^M
^M2022-12-26 00:02:30.64 spid11s     RecoveryUnit::InitPersistentVersionStore failed with db [1] name [master]^M
^M2022-12-26 00:02:30.65 spid11s     Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.^M
^M2022-12-26 00:02:30.66 spid11s     An error occurred during Service Master Key initialization. SQLErrorCode=33095, State=8, LastOsError=0.^M
^M2022-12-26 00:02:30.78 spid11s     SQL Server Audit is starting the audits. This is an informational message. No user action is required.^M
^M2022-12-26 00:02:30.79 spid11s     SQL Server Audit has started the audits. This is an informational message. No user action is required.^M
^M2022-12-26 00:02:30.92 spid11s     SQL Trace ID 1 was started by login "sa".^M
^M2022-12-26 00:02:30.94 spid11s     Server name is 'da4cf7b9967a'. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:31.06 spid27s     Always On: The availability replica manager is starting. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:31.07 spid12s     [32767]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.^M
^M2022-12-26 00:02:31.08 spid27s     Always On: The availability replica manager is waiting for the instance of SQL Server to allow client connections. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:31.09 spid12s     Starting up database 'mssqlsystemresource'.^M
^M2022-12-26 00:02:31.09 spid11s     [4]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.^M
^M2022-12-26 00:02:31.09 spid11s     Starting up database 'msdb'.^M
^M2022-12-26 00:02:31.12 spid12s     The resource database build version is 15.00.4249. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:31.21 spid24s     A self-generated certificate was successfully loaded for encryption.^M
^M2022-12-26 00:02:31.22 spid12s     [3]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.^M
^M2022-12-26 00:02:31.22 spid12s     Starting up database 'model'.^M
^M2022-12-26 00:02:31.22 spid24s     Server is listening on [ 'any' <ipv6> 1433].^M
^M2022-12-26 00:02:31.22 spid24s     Server is listening on [ 'any' <ipv4> 1433].^M
^M2022-12-26 00:02:31.23 spid24s     Dedicated administrator connection support was not started because it is disabled on this edition of SQL Server. If you want to use a dedicated administrator connection, restart SQL Server using the trace flag 7806. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:31.25 spid24s     Server is listening on [ ::1 <ipv6> 1431].^M
^M2022-12-26 00:02:31.25 spid24s     Server is listening on [ 127.0.0.1 <ipv4> 1431].^M
^M2022-12-26 00:02:31.25 spid24s     SQL Server is now ready for client connections. This is an informational message; no user action is required.^M
^M2022-12-26 00:02:31.30 spid11s     RecoveryUnit::InitPersistentVersionStore failed with db [4] name [msdb]^M
^M2022-12-26 00:02:31.31 spid11s     RecoveryUnit::InitPersistentVersionStore failed with db [4] name [msdb]^M
^M2022-12-26 00:02:31.32 spid11s     RecoveryUnit::InitPersistentVersionStore failed with db [4] name [msdb]^M
^M2022-12-26 00:02:31.38 spid12s     Clearing tempdb database.^M
^M2022-12-26 00:02:31.39 Server      Common language runtime (CLR) functionality initialized.^M
^M2022-12-26 00:02:31.56 spid12s     [2]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.^M
^M2022-12-26 00:02:31.56 spid12s     Starting up database 'tempdb'.^M
^M2022-12-26 00:02:31.75 spid27s     The Service Broker endpoint is in disabled or stopped state.^M
^M2022-12-26 00:02:31.75 spid27s     The Database Mirroring endpoint is in disabled or stopped state.^M
^M2022-12-26 00:02:31.77 spid27s     Service Broker manager has started.^M
^M2022-12-26 00:02:31.78 spid11s     Recovery is complete. This is an informational message only. No user action is required.^M
^M2022-12-26 00:02:44.51 spid52      [5]. Feature Status: PVS: 0. CTR: 0. ConcurrentPFSUpdate: 1.^M
^M2022-12-26 00:02:44.51 spid52      Starting up database 'vault'.^M
^M2022-12-26 00:02:44.62 spid52      Parallel redo is started for database 'vault' with worker pool size [2].^M
^M2022-12-26 00:02:44.64 spid52      Parallel redo is shutdown for database 'vault' with worker pool size [2].^M
^M2022-12-26 00:19:41.34 spid64      Attempting to load library 'xplog70.dll' into memory. This is an informational message only. No user action is required.^M
^M2022-12-26 00:19:41.37 spid64      Using 'xplog70.dll' version '2019.150.4249' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.^M
^M2022-12-27 00:00:00.38 Backup      Database backed up. Database: vault, creation date(time): 2022/03/28(22:45:41), pages dumped: 1316, first LSN: 48:32584:1, last LSN: 48:32608:1, number of dump devices: 1, device information: (FILE=1, TYPE=DISK: {'/etc/bitwarden/mssql/backups/vault_FULL_20221227_000000.BAK'}). This is an informational message only. No user action is required.^M
^M2022-12-27 00:00:00.45 Backup      BACKUP DATABASE successfully processed 1306 pages in 0.162 seconds (62.958 MB/sec).^M

Personally, I wouldn’t be worried. Microsoft products have a habit of reserving as much memory as they can get their dirty mitts on, if you have a look at the RES column as well as the MEM% column, you’ll see that they’re not actually using anywhere near what they’ve reserved in virtual memory, only a combined usage of around 1 GB of RAM.

If you’re really concerned about the containers’ ability to consume that much RAM, you can put resource limits on the containers as per this docker docs page: docker container update | Docker Docs