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
| Phase | Typical time | How to shorten it |
|---|---|---|
| Schedule a GPU | Under 1 s, longer when throttled | Add fallback pools and regions. |
| Pull image | 5 to 60 s on a new host | Start from the Apipods base image; keep your layers small; move weights to a network volume. |
| Start container | 1 to 3 s | Avoid heavy shell entrypoints. |
| Module-level init | Seconds to minutes | Load weights in safetensors format from local disk or the volume; skip downloads. |
| Warmstart restore (instead of all of the above) | Typically under 2 s | Keep 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
idleTimeoutInSecso workers survive short gaps in traffic. - Use
QUEUE_DELAYwith a lowerscalerValueto 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
| Symptom | Likely cause | Fix |
|---|---|---|
Jobs stay IN_QUEUE | Workers 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 UNHEALTHY | The 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 error | Model 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 0 | Waited in the queue longer than ttlInSec. | Increase capacity or policy.ttlInSec. |
Jobs end TIMED_OUT after running | Execution timeout too short, or the handler hangs. | Raise executionTimeoutInSec; add timeouts to network calls inside the handler. |
413 payload_too_large | Input 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_enabled | minWorkers set above 0 on a plan without Active workers. | Set minWorkers to 0, or contact sales@apipods.com about the Enterprise plan. |
429 rate_limited | Too many runtime requests. | Respect Retry-After; see the limits below. |
Runtime rate limits
| Scope | Limit | Window |
|---|---|---|
| Runtime /run | 1,000 requests | per 10 seconds, per endpoint |
| Runtime /runsync | 300 requests | per 10 seconds, per endpoint |
| Runtime /status, /stream, /health | 2,000 requests | per 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.