Evaluating Concurrency, Cost, and Infrastructure for LLM Batch Processing
This article explains how to shift LLM evaluation from single-request benchmarks to end-to-end batch system assessment. It covers how concurrency affects total processing time, why throughput varies across the day, how to account for real costs beyond cache hits, client-side resource limits, building reproducible load tests and recovery workflows, and how to choose a solution based on effective output per unit of cost. Readers will learn the key metrics, testing practices, and capacity-planning principles needed to turn batch jobs into predictable, production-ready workflows.
1. From Model Comparison to Task System Evaluation
For workloads with fixed formats, clear rules, and large volumes of repetitive samples, once quality requirements are met, differences between models may no longer be the primary concern. What matters more is end-to-end efficiency: how long the entire job takes, whether the cost stays under control, whether failed work can be recovered, and whether the system remains stable as concurrency increases.
The focus of evaluation should therefore shift from “how fast is a single response?” to “how much effective output does the whole batch produce?” Low latency per request does not necessarily mean the batch finishes quickly, and a high theoretical concurrency limit does not guarantee that the client, network, and service can sustain it. Actual performance depends on the model service’s concurrency capacity, request size, rate limiting, client resources, and how the job is orchestrated.
2. Why Concurrency Reduces Total Runtime
Batch processing typically consists of many independent requests. If they run one after another, total runtime grows roughly linearly with the number of tasks. Splitting the work and submitting requests in parallel lets multiple requests run simultaneously, cutting the waiting time.
More concurrency, however, is not always better. Once concurrency exceeds what the server or the local client can handle, queuing, rate limiting, retries, and connection congestion increase, and throughput can actually decline. A sound approach is to raise concurrency step by step and record the effective completion rate under stable conditions, rather than watching instantaneous peaks.
Use metrics such as the following for comparison:
- Throughput: successfully completed tasks per unit of time, or effective tokens processed.
- End-to-end runtime: from job submission until all results are written to storage.
- Success rate: the share of requests that complete and pass format and content validation.
- Unit cost: the expense per valid sample produced.
- Retry overhead: extra requests caused by timeouts, rate limiting, or invalid results.
Only by counting failures and retries can you avoid mistaking “fast submission” for “fast completion.”
3. Concurrency Capacity Can Vary by Time of Day
The throughput of an online service can be affected by shared resources, service load, and rate-limiting policies. Basing capacity plans on a single time window is therefore risky. If your schedule allows it, run high-priority tasks during stable windows and move non-urgent tasks to off-peak hours. If the workload must run continuously, plan against conservative, peak-hour throughput rather than an idealized peak estimate.
Run load tests across multiple time windows, keeping sample size, prompts, output length, and concurrency settings consistent between runs. For each round, record average latency, higher-percentile latency, success rate, and cost. When throughput drops during peak hours, distinguish between server-side rate limiting, network jitter, and a backlog in the local request queue; mixing these problems together leads to wrong conclusions.
4. Cost Accounting Must Look Beyond Cache Hits
LLM call costs usually depend on input and output usage, and some services also bill separately for cache-related usage. Focusing only on cache hit rates overlooks output length, cache-missed input, and retry volume. For real projects, the most reliable method is to compute the comprehensive cost per unit of effective output from the full batch bill and the number of valid results.
Break down the accounting by input usage, output usage, cache-related usage, and failed requests, and group the numbers by task type. If outputs are much longer than inputs, optimizing output format and length may pay off more than chasing higher cache hit rates. If input templates are highly repetitive, evaluate whether restructuring the prompt improves reuse. Every optimization must still pass quality validation — a reduction in token count alone does not prove the results are better.
5. Local Clients Have Concurrency Limits Too
High concurrency does not only stress the server; it also consumes local memory, CPU, network connections, and disk I/O. The client must maintain request queues, connection state, response buffers, and result objects. As task count and per-item input/output size grow, memory usage typically rises. When the CPU is busy, serialization, parsing, validation, and writing results to disk can themselves become bottlenecks.
Capacity planning should therefore be based on realistic workloads, not on memory capacity alone. Increase concurrency gradually while monitoring memory usage, CPU utilization, network throughput, request wait times, and error rates. If resource usage stays near its limit, reduce concurrency or split the batch. If thermal or power constraints cause CPU throttling, adding concurrency can even reduce throughput.
Practical safeguards include:
- Use bounded queues so the entire workload is never loaded into memory at once.
- Persist results to storage promptly instead of holding response objects in memory for long periods.
- Apply backoff for timeouts and retryable errors to avoid a burst of resubmissions right after a failure.
6. Build Reproducible Load Testing and Recovery
A reliable batch system should first validate input and output formats on a small sample, then use stepwise load testing to find the stable concurrency range. Change only one primary variable per test — concurrency, batch size, or output constraints — so the cause of any throughput change is clear. After reaching the target throughput, run for an extended period to confirm performance does not degrade over time due to resource accumulation or rate limiting.
Job state must also be recoverable. For every record, persist a unique identifier, processing status, attempt count, and a result summary. If the job is interrupted, re-execute only unfinished or explicitly failed tasks. Validate structured outputs and route results that fail the constraints into a separate handling queue, so invalid content never contaminates the final dataset.
7. Select Solutions Based on Effective Output per Unit Cost
Compare services or model options using the same representative set of tasks, with identical inputs, output requirements, and quality criteria. First confirm that result quality meets the business standard, then compare stable throughput, total runtime, cost, and operational overhead. A solution with faster individual responses but limited concurrency may take longer to finish a batch, making it a poor fit for large-scale jobs. High concurrency that produces many failures and retries can also erase an apparent speed advantage.
The goal is not maximum concurrency, but a sustainable balance of quality, speed, cost, and stability. With time-based scheduling, rate-limit control, fault recovery, and resource monitoring, batch processing can evolve from a one-off performance test into a predictable, reproducible, and maintainable production workflow.
