Skip to main content
Benchmarking your Serverless workers helps you identify bottlenecks and optimize your code for performance and cost. Performance is measured by two key metrics:
  • Delay time: The time spent waiting for a worker to become available. This includes the cold start time if a new worker needs to be spun up.
  • Execution time: The time the GPU takes to process the request once the worker has received the job.

Send a test request

To gather initial metrics, use curl to send a request to your endpoint. This will initiate the job and return a request ID that you can use to poll for status.
This returns a JSON object containing the request ID. Poll the /status endpoint to get the delay time and execution time:
This returns a JSON object:

Automate benchmarking

To get a statistically significant view of your worker’s performance, you should automate the benchmarking process. The following Python script sends multiple requests and calculates the minimum, maximum, and average times for both delay and execution.
benchmark.py