For a minimal home server, it possible to reduce RAM usage?

Dear all,

I use Collabora Online together with Seafile Pro for home use (two users), and it works very well. At the moment, without anybody using Collabora, its Docker container uses 1.3 GB of RAM. Is there any way to adjust its settings to reduce baseline RAM usage? I don’t really foresee having more than 5 users accessing documents at the same time.

Thank you in advance.

Nicola

hii @nicolazilio

Adjusting the configuration of Collabora Online’s core daemon, coolwsd is the path to reducing its baseline RAM usage in a Docker container.

Here is a suggestion for a configuration parameter that directly influences the idle memory footprint:

Parameter Configuration Area Description
num_prespawn_children <coolwsd>...<server> in coolwsd.xml This integer value controls the number of helper processes that are launched and kept in memory, ready to open documents immediately. These idle processes consume a significant portion of the baseline RAM you observe.

Lowering this value will reduce the baseline RAM usage, though it may introduce a small delay when opening the very first document after a period of idleness, as the main process will have to launch a new child process on demand.

1 Like

Thank you for the pointer! I’ve mounted directory /etc/coolwsdin the container and edited num_prespawn_children to 1, from the default 4. I do see fewer processes being spawned; however, RAM usage remains unchanged between the two conditions at 1.2 GB. I’m not sure why.

@nicolazilio

When you reduce num_prespawn_children from 4 to 1, you successfully reduce the number of loolforkit processes. However, a significant portion of the memory is consumed by:

The Main Daemon and Shared Memory

  • The main coolwsd process itself, along with all its shared libraries and web service components, consumes a large base amount of RAM (often several hundred MB).
  • The LibreOffice Core is built to use shared memory for many of its largest components, such as fonts, configuration, and LibreOffice libraries. The operating system (Linux) loads these large components into memory once, and all child coolforkit processes share access to that single memory block.

This core memory is shared (using Copy-on-Write) by all document processes and cannot be reduced by changing the num_prespawn_children setting.


Minimum System Requirements (To Ensure Stability)

To ensure your server can operate reliably without swapping, you must meet the following minimum resource requirements:

Component Minimum Requirement Reason for Requirement
RAM (Base) 2 GB RAM Required to load the OS, the main coolwsd process, and the large Shared LibreOffice Core (fonts, libraries), which is the static memory footprint.
RAM (Per User) +100 MB per Concurrent User/Document Each active document needs its own isolated Kit process for rendering, consuming memory in addition to the base core.
CPU 2 Cores Necessary for the kernel to effectively schedule the main web daemon and multiple, isolated document rendering processes in parallel.
2 Likes