Skip to main content
Use this page when an alert fires or users report a problem. Each issue lists how to find the cause and what to change. For when to alert, see Recommended SmithDB alerts. For what each metric measures, see Essential SmithDB metrics.

Start from a symptom

If users report a problem, find the symptom below. Then go to the issue that it links to.

LangSmith ingestion falls behind

LangSmith keeps each new run in Redis until an ingest queue worker writes it to SmithDB. If ingestion cannot keep up, the queue in Redis increases, and users see their runs late. LangSmith deletes run data in Redis after the time set by config.settings.redisRunsExpirySeconds, 6 hours by default. Retries do not extend this time. If the queue gets too old, or Redis gets full, LangSmith loses runs. Alerts: 1. Runs are lost, 3. The ingestion backlog gets old, 4. Redis is almost full.

Find the cause of the backlog

Reduce the backlog

  • Scale ingest queue workers on the queue length. The workers mostly wait for the network, so their CPU stays low while the queue increases. An autoscaler that uses CPU does not add workers. Enable KEDA for the ingest queue, which scales on the queue length. If a NetworkPolicy limits traffic in the namespace, make sure that KEDA can still read the queue length. If it cannot, KEDA does not scale the workers, and it does not show an error.
  • Set the maximum replica count from your peak load. The chart’s default maximum is a starting point, not a value for your load. Each worker opens connections to Redis, so increase the maximum in small steps and monitor the CPU of the busiest Redis shard.
  • Size Redis for the backlog. Redis must hold all pending runs until the workers write them, including while writes are slow. If its memory gets near the limit, or it evicts keys, increase its memory.

Writes to SmithDB fail or are slow

SmithDB ingestion writes runs to object storage as segments and records the metadata of each segment in the metastore. A write is durable only when both steps succeed. If writes fail, LangSmith tries them again from Redis, and the ingestion backlog increases. Alerts: 5. Writes fail, 8. Writes are slow.

The metastore runs out of capacity

The metastore is the PostgreSQL database of SmithDB. SmithDB records the metadata of each segment that it writes in the metastore. The metastore also holds new feedback until compaction moves it. A slow metastore makes ingestion, queries, and compaction slow at the same time. When there are no more connections or no more storage, writes fail. Alert: 7. The metastore is saturated. To size the metastore, see Metastore capacity.

Compaction falls behind and queries get slow

SmithDB ingestion writes many small segments. Compaction merges them into fewer, larger segments. If compaction falls behind, each query must open more segments. Queries then get slow, time out, or SmithDB rejects them. Alerts: 6. Queries fail, 9. Queries are slow, 10. Compaction falls behind, 11. Compaction stops or fails.

Find the cause of late compaction

Find the cause of slow or failed queries

Queries can also get slow or fail for other reasons. Before you scale compaction, compare these signals:

Help compaction keep up

  • Add compaction workers. By default, the autoscaler scales compaction workers on CPU, not on pending jobs. To scale on pending jobs, see Scale with KEDA instead. If the workers are at their maximum replica count, increase the maximum.
  • Give compaction workers more memory if they are OOM-killed, or if most of them stay near their capacity limit. Worker capacity is 80% of the pod memory limit, so more memory lets larger jobs run. Select a larger tier or set the resources of the compaction worker.
  • Limit the time range of queries. Scripts and API clients that query without a start time make SmithDB read data from all days.
  • Use time-based trace IDs. If your application sets its own run or trace IDs, use UUIDv7 values. SmithDB uses the time in the ID to find the data of a trace. Random IDs, such as UUIDv4, make queries and deletes read much more data.

One kind of query load slows down other queries

In cluster mode, the query service serves all SmithDB reads. A heavy load of one kind, such as run statistics on a large project, can slow down all other queries. Dedicated query services move one kind of load to its own pods, so you can size and scale it separately. Alert: 2. Feedback is lost. For large deployments, such as the large tier, enable the dedicated query services. Each service needs its own replicas, with the resources of the query tier. For smaller deployments, enable a service when you see its signals in the following table. To find which kind of request uses the query pods, split server_requests_duration on query pods by path. Query pods often use all their memory while their CPU stays low. An autoscaler that uses CPU does not add replicas in this case. Set a minimum replica count that holds your normal load, or give the pods more memory.

SmithDB pods are not healthy

A SmithDB pod that restarts stops its work in progress: writes, queries, and compaction jobs. A component without available pods sends no metrics, so the alerts that use its metrics do not fire. Alerts: 12. A component has no pods, 13. Pods restart often, 14. SmithDB panics. Run kubectl describe pod <pod>, and read the logs of the previous container with kubectl logs -p <pod>. Then compare with this table: