Environment Variables

RIZA_API_KEY

The API key to use when talking to the Riza API. This is only needed when using custom runtimes.

RIZA_LICENSE_KEY

The license key to validate on startup. If the license is invalid, riza serve will return an error.

RIZA_SERVE_WORKERS

The number of worker threads to run. Defaults to the number of CPU cores divided by two.

Added in rizio/code-interpreter:0.4.6

RIZA_SERVE_QUEUE_SIZE

The size of the work queue shared among workers. Defaults to the number of workers.

Added in rizio/code-interpreter:0.5.0

RIZA_SERVE_QUEUE_SEND_TIMEOUT

The amount of time (in seconds) to wait for an item to be added to the work queue. If the timeout is reached, the server will send a 429 Too Many Requests response. If set to 0, return 429 Too Many Requests if the queue is full. Defaults to 5 (seconds).

Added in rizio/code-interpreter:0.5.0

RIZA_SERVE_CONCURRENCY

The maximum number of concurrent requests to handle. When set, reqeusts will be processed in the order in which they’re receieved. By default there is no limit set.

Liveness and Readiness Probes

The /livez and /readyz endpoints can be used for readiness and liveness probes when deploying into a Kubernetes cluster.

Prometheus Metrics

The /metrics endpoint contains the following metrics

http_requests_total

A counter for each HTTP request, grouped by {method, path, status}.

# TYPE http_requests_total counter
http_requests_total{path="/v1/execute",method="post",code="429"} 280 1741728377372
http_requests_total{path="/v1/execute",method="post",code="200"} 340 1741728377372

http_requests_inflight

A gauge for the number of current HTTP requests, including liveness and readiness probes and the metrics endpoint itself.

# TYPE http_requests_inflight gauge
http_requests_inflight 76 1741728377372

worker_queue_size

A gauge for the size of the work queue.

# TYPE worker_queue_size gauge
worker_queue_size 10 1741728377372

num_workers

A gauge for the number of workers.

# TYPE num_workers gauge
num_workers 5 1741728377372

work_items_queued

A gauge for the number of work items waiting for a spot in the queue.

# TYPE work_items_queued gauge
work_items_queued 65 1741728377372

work_items_inflight

A gauge for the number of inflight work items, which includes items waiting for a spot in the queue.

# TYPE work_items_inflight gauge
work_items_inflight 75 1741728377372