Docs / Serverless

Troubleshooting & cold starts

Most serverless problems fall into a few patterns: slow cold starts, jobs waiting for workers, and workers that crash. Here is how to recognise and fix each one.

Anatomy of a cold start

PhaseTypical timeHow to shorten it
Schedule a GPUUnder 1 s, longer when throttledAdd fallback pools and regions.
Pull image5 to 60 s on a new hostStart from the Apipods base image; keep your layers small; move weights to a network volume.
Start container1 to 3 sAvoid heavy shell entrypoints.
Module-level initSeconds to minutesLoad weights in safetensors format from local disk or the volume; skip downloads.
Warmstart restore (instead of all of the above)Typically under 2 sKeep warmstart enabled; avoid frequent env changes.

delayTime on a job includes any cold start it waited for. The coldStarts and warmstartRestores counts on metrics tell you which path workers took.

Reducing cold starts

  • Raise idleTimeoutInSec so workers survive short gaps in traffic.
  • Use QUEUE_DELAY with a lower scalerValue to scale up earlier during ramps.
  • Send a lightweight warm-up job a minute before predictable traffic peaks.
  • For strict latency targets, add Active workers (minWorkers); contact sales.

Common problems

SymptomLikely causeFix
Jobs stay IN_QUEUEWorkers are THROTTLED, maxWorkers is reached, or the account worker quota is used up.Check /health. Add pools or regions, raise maxWorkers, or ask support to raise the quota.
Workers cycle through UNHEALTHYThe container exits during startup: missing dependency, wrong CMD, or the handler file crashes on import.Read the worker logs with apipods logs ep_4n8wq2zt; reproduce with local testing.
CUDA out of memory in errorModel plus activations do not fit the pool's VRAM, or concurrency is too high.Use a larger pool, a quantized model, smaller batches or lower concurrency.
Jobs end TIMED_OUT with executionTime 0Waited in the queue longer than ttlInSec.Increase capacity or policy.ttlInSec.
Jobs end TIMED_OUT after runningExecution timeout too short, or the handler hangs.Raise executionTimeoutInSec; add timeouts to network calls inside the handler.
413 payload_too_largeInput above 10 MB (/run) or 20 MB (/runsync).Upload large files to a network volume or object storage and pass a URL.
403 active_workers_not_enabledminWorkers set above 0 on a plan without Active workers.Set minWorkers to 0, or contact sales@apipods.com about the Enterprise plan.
429 rate_limitedToo many runtime requests.Respect Retry-After; see the limits below.

Runtime rate limits

ScopeLimitWindow
Runtime /run1,000 requestsper 10 seconds, per endpoint
Runtime /runsync300 requestsper 10 seconds, per endpoint
Runtime /status, /stream, /health2,000 requestsper 10 seconds, per endpoint

Getting help

If you are still stuck, contact support with the endpoint ID, an affected job ID and the Apipods-Request-Id header from a failing request. Check platform status first for ongoing incidents.