Ocis v8.2.2 high CPU and RAM use

Steps to reproduce

  1. install v8.2.2 on docker → proxmox LXC, give it 4 cores and 4GB of RAM, 8GB swap.

  2. move data to external drive in LXC folder outside docker container (not sure if this has anything to do with it)

  3. install windows client, sync folder

  4. drop 20GB of ~1MB photos into windows “personal” folder

  5. observe high CPU and RAM usage on server

Expected behaviour

Minimal impact on CPU expected.

Actual behaviour

Ryzen 4600G, four cores, 4GB of RAM, SSD. When syncing photos, CPU usage rises to 80% and stays there. Actual data transfer rate ~15MB/s (much lower than link capability). RAM usage increases from ~512MB to 3GB.

Edit: CPU and RAM usage remained when file transfers/sync has finished. htop says CPU is being used by “ocis server”. I did not want to burn any more electricity, so I restarted docker. High usage continued. Then I restarted LXC. Memory use dropped to 700MB, CPU usage remained at 40%. After 7 more minutes CPU usage dropped to <1%.

Not sure what it was doing.

Server configuration

Operating system: proxmox v9.1.5, kernel 6.17.9-1-pve, CPU ryzen 4600G

ownCloud version: oCIS v8.2.2

Updated from an older ownCloud or fresh install: fresh install

Where did you install ownCloud from: GitHub - owncloud/ocis: ⚛ ownCloud Infinite Scale · GitHub

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.

The content of config/config.php:

there is no php?

List of activated apps:

none

Are you using external storage, if yes which one: local outside container

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Operating system: windows 11

Logs

Web server error log

no idea where to get them

ownCloud log (data/owncloud.log)

no idea where to get them

Hey @elektrinis
Thanks for bringing this to our attention.
Just a quick update - We’ve made the team aware of this post and are taking a look at this.
We will let you know if we have any questions or updates.
Please feel free to update with any changes/questions in the meantime, of course!

Thanks again!

Without any additional information, it seems the expected behavior.

I don’t think neither the desktop client nor oCIS impose any restrictions on the connection by themselves. This means that the desktop client might send 20k upload requests at the same time (or as soon as possible) while oCIS might try to handle them all at once. This might be too much for your hardware.

Note that the upload isn’t just writing the bytes into the disk. We need to generate the thumbnail, index the file, and maybe scan the file for virus (if antivirus is enabled). This will take additional resources, and more time until the upload is finished.

If this is just a “once and done” action, I assume the usual CPU and RAM usage will stay at acceptable levels, so I don’t think you need to do anything. On the contrary, if it happens frequently, you might want to use more hardware and/or scale the system. Of course, there might be a bug somewhere, but it will be difficult to prove it.


If you need some monitoring, you might want to use “jaeger” or something similar to know what’s going on. oCIS has support for opentelemetry so it can send data to jaeger (or another tool compatible with opentelemetry) to visualize the information.

Basic setup is, in any relevant oCIS container, add the following env vars:

      OCIS_TRACING_ENABLED: "true"
      OCIS_TRACING_TYPE: "otlp"
      OCIS_TRACING_ENDPOINT: jaeger:4317

the endpoint points to a jaeger container, with default configuration:

  jaeger:
    image: jaegertracing/jaeger:2.7.0
    networks:
      ocis-net:
    ports:
      - "16686:16686"
    environment:
      COLLECTOR_ZIPKIN_HTTP_PORT: 9411
    restart: always

The exposed port is to visualize the information via HTTP, so you can access there using a browser. I don’t know if it has some authentication available or anyone can access there. Exposing the port isn’t strictly needed, it’s just easier access. Up to you how you want to secure it. I’d recommend to play around in a safe environment to check if it fits your needs before setting it up in production.

Side note: consider the data in jaeger as “informational”. There is work to do, so some data might be inconsistent, weird, or even erroneous. (I need to update the docker image…)

@elektrinis we did some testing on our side and confirm this is the case. We have identified two main reasons for the high cpu / ram usage: search and activitylog. Activitylog needs to store one event per upload. With a lot of uploads it takes longer to work the queue off. Search reindexes the whole space after each upload. There is a debouncer, so the space gets only reindexed once, but each item is index separately, there is no batching. Both issues together result in the load you see. Here are some numbers from the local test:

Run Uploads Upload time CPU busy after upload Peak RSS
A: all services 3000 × 201 112 s ~171 s at ~100–130% ≥ 647 MB (sampler started late)
B: OCIS_EXCLUDE_RUN_SERVICES=activitylog 3000 × 201 96 s ~186 s at ~100% 512 MB
C: OCIS_EXCLUDE_RUN_SERVICES=search 3000 × 201 103 s ~61 s at ~130–150% 580 MB

We have created bugs for both and added them to our queue. There is two remediations you could do right now if you don’t need the respective feature:

Disable search. Impact: No searching for files or folder.

Disable activitylog. Impact: No activity history on files/folders. SSEs and mail notifications are not affected.