AI agents: use the documentation index at llms.txt to locate machine-readable pages. This section is indexed by https://docs.particular.net/servicecontrol/llms.txt. The markdown version of this page is served as plain text. An MCP server at /mcp serves the same content via the search_docs and read_doc tools; it is read-only and needs no credentials. Markdown versions of documentation pages are available by appending .md to the page URL. Directory URLs use index.md. They are served as text/plain because some retrieval backends reject text/markdown.

Scaling out audit ingestion

Component:
ServiceControl

When one ServiceControl Audit instance cannot ingest audit messages fast enough, run additional Audit instances. The instances can read from:

Where the instances store data does not depend on which queue they read from. It depends on the storage type:

StorageEach additional Audit instance usesRegister as a remote
RavenDBIts own RavenDB databaseEvery instance
SQL Server or PostgreSQL, shared databaseThe same database, schema, and message body store as the first instanceOnly one instance
SQL Server or PostgreSQL, separate databasesIts own database, or its own schema, and its own message body storeEvery instance

When to scale out

First tune a single instance. See the performance tuning settings for the concurrency, batch size, batch timeout, and parallel writer settings.

Add instances only when one instance can no longer keep up, for example when the audit queue keeps growing. Additional instances increase the load on the transport and on storage. Measure the combined result; do not assume linear speedup.

When several instances read from the same queue, the transport must allow several consumers on that queue. Verify this for the transport in use.

Separate audit queues also allow groups of endpoints to keep their audit data for different periods, but only when the instances do not share a database.

RavenDB storage

Each Audit instance stores its data in its own RavenDB database: an embedded database for instances deployed with the ServiceControl Management Utility or PowerShell, or a separate RavenDB container for container deployments. Do not point two Audit instances at the same RavenDB database.

Register every Audit instance as a remote instance of the Error instance. The Error instance queries each of them and combines the results.

SQL storage: shared database

With SQL Server or PostgreSQL storage, additional Audit instances can use the same database and schema as the first instance. All instances write to the same tables, so any one of them can return every ingested audit message, whichever queue it came from. Use this option when ingestion, not the database, is the bottleneck. The following diagram shows instances that read from one queue; instances that read from separate queues share the database in the same way.

graph TD AuditQueue[Audit queue] Audit1[Audit instance 1<br/>registered as remote] Audit2[Audit instance 2] AuditN[Audit instance N] Database[(Shared database and schema)] BodyStore[Shared body store] Error[Error instance] AuditQueue --> Audit1 AuditQueue --> Audit2 AuditQueue --> AuditN Audit1 --> Database Audit2 --> Database AuditN --> Database Audit1 --> BodyStore Audit2 --> BodyStore AuditN --> BodyStore Error -. queries .-> Audit1

Keep configuration changes consistent across all Audit instances that share a database and schema. The audit queue is the exception: instances can use different ServiceBus/AuditQueue values to ingest from separate audit queues.

In particular, every instance that shares the database must use the same:

  • ServiceControl.Audit/StorageType, Database/ConnectionString, and Database/Schema settings.
  • ServiceControl.Audit/MessageBody/* settings. The instance that answers queries reads bodies that any instance has written, so all instances need permission to read, write, and delete bodies in one shared store. Azure Blob Storage and Amazon S3 are shared by design. File system storage works only when the path is a shared mount.
  • ServiceControl.Audit/AuditRetentionPeriod. Each instance removes expired messages from the shared tables and body store, so the shortest retention period applies to all messages.
  • ServiceControl version.

If the registered instance stops, audit messages remain in the database, but ServicePulse cannot show them until that instance is available again. The other instances keep ingesting.

Setup and upgrades

Run setup once, from one instance, before starting the others. The other instances use the schema that setup created.

To upgrade:

  1. Stop all Audit instances that share the database.
  2. Upgrade one instance and run setup.
  3. Start that instance.
  4. Upgrade and start the other instances.

SQL storage: separate databases

When the database is the bottleneck, give each additional Audit instance its own database, ideally on a separate server. Each instance then has its own storage, like an Audit instance that uses RavenDB:

  • Give each instance its own database, or its own schema in a shared database. A separate schema keeps the data apart but does not spread the database load.
  • Give each instance its own message body directory, container, or key prefix. See external message body storage.
  • Register every instance as a remote instance of the Error instance.

Instances in this setup can use different retention periods, because each one removes expired messages only from its own storage.

Notifications

Every Audit instance, whether registered as a remote or not, sends notifications such as endpoint detection to the Error instance. Set ServiceControl.Audit/ServiceControlQueueAddress on each of them to the Error instance's queue.