OpenCloud · Scaling
Bleve for everyone, OpenSearch for large installations
If you copied large amounts of data into OpenCloud or ran spaces with hundreds of members, in spring 2025 you ran into sustained load and long loading times. Between 2.3.0 and 3.4.0 these spots got attention: the activitylog buffers its writes and can run with multiple instances, space lists no longer load their members, search and postprocessing expose metrics, and search indexes in batches. Since 3.4.0 you can also connect an external OpenSearch; Bleve remains the default.
In April 2025, an operator reported that after copying a larger amount of data, their OpenCloud kept one CPU core fully busy for days. Others confirmed the picture: about 200 GB copied directly into the file system, eight cores busy for hours, a log that kept scrolling every second. The issue is a good starting point for this look back because it shows what matters in operations. A system with few files and users behaves differently from one with millions of files and spaces where hundreds of people work. If you run OpenCloud, you should notice as little of that as possible. A large import should succeed without special knowledge, and when something hangs, you need measurements instead of guesses.
Activitylog without sustained load
The cause turned out to be the activitylog service, which stores the activities for every file and folder that appear in the sidebar. For each event, it looked up the parent folders by querying storage, over and over for the same folders. On top of that, each resource had a list of up to 6000 entries stored as JSON in the NATS key-value store, which was read in full and rewritten for every new event. Profiling after copying 50,000 small files showed the activitylog taking about half of the CPU time, around half of that spent converting JSON.
Since 2.3.0, the service buffers its writes and writes them in bulk, every ten seconds by default (ACTIVITYLOG_WRITE_BUFFER_DURATION, default 10s). It keeps parent folders in a cache or takes them directly from the event instead of querying them for every event. It stores the lists in MessagePack format instead of JSON. The changes are backward compatible. The trade-off: a new activity can show up in the sidebar up to ten seconds later.
If you're planning a very large import, you can still turn off the activitylog temporarily with OC_EXCLUDE_RUN_SERVICES=activitylog. The developers deliberately decided against disabling the service by default. The activity history is useful to users and should work in large installations too.
The second step followed in 3.0.0. Until then, the activitylog could not be spread safely across multiple instances: each instance read a resource's list, added to it and wrote it back, so activities could get lost when two instances wrote at the same time. The service now stores activities in chunks per resource directly in NATS. This lets multiple instances run side by side. The per-resource limit is now configurable (ACTIVITYLOG_MAX_ACTIVITIES, default 6000). The service migrates existing data to the new format automatically on first start; there's nothing to do by hand.
Faster space lists
The second problem affected spaces with many members. On a test system with 600 users, the request for the list of your own spaces took 14 seconds. To answer it, the server resolved every member of every space individually, even though the web UI fetches the member list separately only when you open a space.
Since 3.0.0, the Graph API no longer includes a space's permissions automatically when listing spaces. In a measurement with one space of 500 members, the request time dropped from about seven seconds to around 200 milliseconds. If you still need the permissions, you request them explicitly, for example with /graph/v1.0/me/drives?$expand=root($expand=permissions). Also new are $filter, to get only members without public links, and $count, to query only the number of permissions. Because this changes the API's behavior, the major version went up to 3. No migration is needed, but your own scripts and integrations that read permissions from the space list have to add the $expand.
The member list of a single large space stays slower, because the server has to resolve every member for it. This limitation still exists after 3.0.0.
Event queue monitoring
After a large import, the question often comes up whether OpenCloud is still working or stuck. Many services process events from NATS, among them search, which indexes new files, and postprocessing, which finalizes uploads after they arrive. From 3.2.0 on, both services expose Prometheus metrics at /metrics on their debug address (SEARCH_DEBUG_ADDR, default 127.0.0.1:9224, and POSTPROCESSING_DEBUG_ADDR, default 127.0.0.1:9255). These include the number of unprocessed events (opencloud_search_events_unprocessed, opencloud_postprocessing_events_unprocessed), pending acknowledgments and redelivered events. Search also measures the duration of queries and indexing runs, postprocessing the number of running and completed jobs and their duration. If you feed these values into your existing monitoring, you can see whether a queue is shrinking or growing.
Bleve for small, OpenSearch for large instances
By default, search uses Bleve, a search library that runs inside the OpenCloud process and keeps its index in the file system. That suits most installations because no additional service is needed. Since 3.3.0, when indexing an entire space, for example with opencloud search index --all-spaces, search writes in batches instead of one document at a time. The pull request cites a roughly 50-fold speedup for indexing and deleting. You can set the batch size with SEARCH_BATCH_SIZE; the default is 500.
Bleve has one limitation: the index belongs to exactly one process, which locks it. That rules out running multiple search instances, as is common in Kubernetes for high availability. So OpenCloud 3.4.0 adds a connection to an external OpenSearch. Indexing and queries then go through OpenSearch, and multiple OpenCloud instances can share the same index. The connector translates the KQL query language into OpenSearch queries, including shorthands such as document, image or PDF, and supports highlighting in results.
OpenSearch is off by default. You turn it on with SEARCH_ENGINE_TYPE=open-search and the cluster address in SEARCH_ENGINE_OPEN_SEARCH_CLIENT_ADDRESSES, and if needed SEARCH_ENGINE_OPEN_SEARCH_CLIENT_USERNAME, SEARCH_ENGINE_OPEN_SEARCH_CLIENT_PASSWORD and SEARCH_ENGINE_OPEN_SEARCH_CLIENT_CA_CERT. The index is named opencloud-resource by default (SEARCH_ENGINE_OPEN_SEARCH_RESOURCE_INDEX_NAME). An existing Bleve index is not carried over; after switching, you rebuild the index with opencloud search index --all-spaces.
The state of 3.4.0 also includes what's still missing. Batch indexing only applies to Bleve; the OpenSearch connector still writes document by document. The documentation is limited to the environment variables, and the description of SEARCH_ENGINE_TYPE still lists bleve as the only value. Running and securing the OpenSearch cluster itself is up to the operator. If you don't depend on multiple search instances, you're best off staying with Bleve.
Before you update
None of these changes require anything from admins as long as they don't want to change anything: the activitylog migration runs at startup, batches are on, Bleve stays the default. If you want more, you get new settings and metrics. And if you run scripts against the Graph API, check before updating to 3.0.0 whether they read permissions from the space list.
Sources
- Activitylog service creates endless load on the backend after uploading, GitHub, 2026-12-04
- Reduce load caused by the activitylog service, GitHub, 2026-12-04
- activitylog can not safely be scaled horizontally, GitHub, 2026-12-04
- Make activitylog service scalable, GitHub, 2026-12-04
- listing a space shared to many users takes too long, GitHub, 2026-12-04
- do not automatically expand drive root permissions, GitHub, 2026-12-04
- graph: Add support for counting permissions, GitHub, 2026-12-04
- graph: Add $filter to only list (and/or count) member permissions, GitHub, 2026-12-04
- Expose metrics for nats consumer queues length, GitHub, 2026-12-04
- Metrics, GitHub, 2026-12-04
- Improve indexing performance using batches, GitHub, 2026-12-04
- Search-service: add opensearch as distributed search backend, GitHub, 2026-12-04
- Release 3.0.0, GitHub, 2026-12-04
- Release 3.4.0, GitHub, 2026-12-04
- Search Service, Environment Variables, OpenCloud Docs, 2026-12-04