Request execution capacity

  • Bound request workers, task waiting and in-flight work alongside HTTP/DB pools, deadlines and CPU/memory headroom.
100%

One JVM · phase-neutral design mechanism; numbers in the reader are illustrative

One application JVM · local limits multiply across replicasRequest capacity: sockets, execution, in-flight work and resourcesRequest / responseDatabaseControl / stateFailure / rejectionacceptready tasksdispatchparse / authpermit availableno permitHTTP acquire / callDB acquire / SQLshared resource budgetdeadline policyConnections waiting for acceptance are held by the OS listen backlog, subject to OS behavior; acceptCount is the requested bound. This is not the Executor task queue or a queue of authenticated business requests. A full backlog can produce refusal or connect timeout.OS acceptbacklogmaxConnections counts Connector connections, including idle keep-alive sockets. The NIO poller observes socket readiness and submits processing tasks. A socket is not a business operation. Keep-alive reuses sockets; HTTP/2 can multiplex streams. Socket settings remain owned by each Connector.Connectoraccepted socketsQueued Runnable socket-processing tasks wait for Executor workers; Tomcat TaskQueue also encourages pool growth toward maxThreads under demand. The named Executor owns maxQueueSize. Full-queue rejection need not become HTTP 503; socket-processing submission can fail before application response handling.Executor taskqueueThe named standard Executor owns maxThreads, minSpareThreads and maxQueueSize. Connector maxThreads is ignored when that Executor is referenced. Parsing and authentication already consume execution capacity. Synchronous client-pool acquisition and provider/DB waits retain the worker. All Connectors naming this Executor share it.Request workersshared ExecutorIllustrative nonblocking admission after authentication: a request worker and pre-gate CPU have already been consumed. This gate cannot prevent the OS backlog or Executor task queue. When no permit is available, policy can deliberately reject the request; admitted work holds its permit until actual logical completion. No deployed OBRH gate or limit is asserted.Business gateafter authAdmitted logical operations remain counted while they execute or wait. The worker, business permit and downstream leases have different lifetimes and overlapping occupancy. Synchronous waits retain a servlet worker. Servlet async can release that worker between dispatches but work, retained state and permits remain in flight until actual completion or confirmed cancellation. Business work in flightsynchronous or asyncAn application gate that is already executing can choose an intentional overload response. Its policy, status, retry behavior and observability must be explicit. Executor or backlog overflow is a different failure boundary and does not guarantee the same response. A rejected post-auth request already spent early execution resources.Explicit policyrejectionThe actual HTTP manager and selected route own connection or stream capacity. Leased capacity and pool-acquisition waiting are distinct populations. HTTP pools are a genuine request-resource boundary, but not the whole request capacity or a TPS promise. Synchronous acquisition/remote waits also retain a request worker; response closure releases leases. HTTP client poolleases + waitersThe physical DB-pool owner controls borrow capacity and acquisition waiting independently of servlet workers and HTTP leases. A client pool is not itself a persistent database. Count all distinct pools and JVM generations; SQL time, locks and database sessions can bottleneck before a configured pool maximum. DB poolborrows + waitersWorkers, queues, clients and async state share the same JVM/container CPU and memory. More threads can increase memory and downstream contention without raising useful throughput. Multiply actual resource owners across active, preview and draining replicas. Six separate 12-session DB pools permit 72 sessions before other consumers. CPU, memory and replica headroomshared by all local workOne business deadline is spent across queueing, execution, resource acquisition, provider attempts and response handling. Connector connectionTimeout is not that deadline. The worked 240 requests/s example evaluates average occupancy, a 40-task burst buffer and provider slowdown. It is illustrative arithmetic, not measured safe capacity.Remaining timeacross all waitsacceptready tasksdispatchparse / authpermit availableno permitHTTP acquire / callDB acquire / SQLshared resource budgetdeadline policy

Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.

  • Synchronous path: worker → post-auth gate → business work → HTTP/DB resources. Blocked waits can retain the same request worker.
  • Async lifetime: the worker can return between dispatches; business work, permits and client resources still need bounded completion and cancellation.
  • Queue symbols count connections or Runnable tasks. Client pools count leases/borrows; neither is a storage cylinder or a TPS guarantee.
  • Queues show possible waiting states: work need not wait in both. The simplified dispatch path does not make one task equal one business request.
  • Select workers/queue for the real Tomcat XML fragment, or remaining time for the worked 240 requests/s calculation.
Endpoint and provider isolation

Endpoint and provider isolation

Java 17 operation bulkheadsjava
package example.obrh;

import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.Semaphore;

/** Java 17 synchronous example. Construct ONCE per JVM/capacity domain, not per request. */
public final class EndpointBulkheads {
    // Illustrative aggregate provider work; separate from the Tomcat request gate.
    // Coupled profile: 12 shared-route HTTP connections in HttpPoolExample, A <= 8,
    // B <= 4, and no other unbudgeted users of that transport route.
    private final Semaphore providerTotal = new Semaphore(12);
    // Bounded canonical identities from trusted operation classification.
    private final Map<String, Semaphore> operations = Map.of(
            "providerA.balance", new Semaphore(8),
            "providerA.payment", new Semaphore(4));

    public <T> T invoke(String operation, long deadlineNanos, Callable<T> attempt)
            throws Exception {
        Semaphore local = operations.get(operation);
        if (local == null) {
            throw new IllegalArgumentException("Unknown operation");
        }
        if (System.nanoTime() - deadlineNanos >= 0 || !providerTotal.tryAcquire()) {
            throw new RejectedExecutionException("Provider work budget exhausted");
        }
        boolean admittedOperation = false;
        try {
            admittedOperation = local.tryAcquire();
            if (!admittedOperation) {
                throw new RejectedExecutionException("Operation work budget exhausted");
            }
            if (System.nanoTime() - deadlineNanos >= 0) {
                throw new RejectedExecutionException("Deadline expired before attempt");
            }
            // Borrow HTTP/DB resources INSIDE this scope with remaining-deadline waits.
            // This synchronous Callable must return only after underlying work stops.
            // Release its response/connection in its own try-with-resources.
            return attempt.call();
        } finally {
            if (admittedOperation) {
                local.release();
            }
            providerTotal.release();
        }
    }
    // Retry outside invoke: backoff holds no attempt permit/HTTP lease.
    // Retain logical request admission until the whole request really completes.
    // Permits bound competition, not scheduling guarantees. Useful B capacity also
    // needs coherent pool sharing/lease behavior and adequate CPU/DB/provider capacity.
}
Bounded blocking executor illustrationjava
package example.obrh;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/** Java 17 optional blocking-worker example; one managed instance per isolation domain. */
public final class BoundedBlockingExecutor {
    private BoundedBlockingExecutor() { }

    public static ThreadPoolExecutor create() {
        return new ThreadPoolExecutor(8, 8, 0L, TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<>(16),
                new ThreadPoolExecutor.AbortPolicy());
    }
    // RejectedExecutionException must map to a deliberate overload response.
    // Do not use CallerRunsPolicy: it can move provider stalls back onto Tomcat workers.
    // Submission requires logical admission and a finite remaining deadline.
    // Acquire attempt permits in the worker immediately before scarce-resource waits.
    // Observe queue delay separately; remove/cancel queued work when its deadline ends.
    // Release active permits only when the worker actually exits, not when Future.cancel
    // returns. Interruption does not guarantee that an underlying provider call stops.
    // Propagate bounded trace/security/tenant context explicitly; clear it in finally.
    // Owner drains/shuts down this executor as part of the application lifecycle.
}
HTTP manager ownership

HTTP manager ownership

  • Identify the actual shared manager and route before assigning endpoint budgets. Close responses and retire replaced manager generations deliberately.
Apache HttpClient 4.5 pool examplejava
package example.obrh;

import java.io.IOException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.util.EntityUtils;

/** Apache HttpClient 4.5 API example; not a claim about the installed client version. */
public final class HttpPoolExample implements AutoCloseable {
    private final CloseableHttpClient client;

    public HttpPoolExample() {
        PoolingHttpClientConnectionManager manager =
                new PoolingHttpClientConnectionManager();
        manager.setMaxTotal(24); // Illustrative total sockets for this manager.
        manager.setDefaultMaxPerRoute(12); // Transport route, NOT each business URL.
        // Coupled EndpointBulkheads profile: A8 + B4, aggregate12, all route users
        // budgeted, no multiple retained leases per attempt. Other route consumers
        // can invalidate the intended headroom; partition resources if required.
        RequestConfig budgets = RequestConfig.custom()
                .setConnectionRequestTimeout(200) // Pool lease wait, milliseconds.
                .setConnectTimeout(500) // Socket establishment, milliseconds.
                .setSocketTimeout(1000) // Read inactivity, not complete request deadline.
                .build();
        client = HttpClients.custom().setConnectionManager(manager)
                .setDefaultRequestConfig(budgets)
                .disableAutomaticRetries() // One retry owner, explicit operation contract.
                .evictExpiredConnections()
                .evictIdleConnections(30, java.util.concurrent.TimeUnit.SECONDS)
                .build(); // Client owns manager and eviction lifecycle.
    }

    public int readOnlyStatus() throws IOException {
        // Use an operation bulkhead before execution and restrict response sizes.
        HttpGet request = new HttpGet("https://provider.example.com/reference-data/status");
        try (CloseableHttpResponse response = client.execute(request)) {
            int status = response.getStatusLine().getStatusCode();
            EntityUtils.consume(response.getEntity()); // Release reusable lease.
            return status;
        } // On failure, close response/connection; never retain an unconsumed response.
    }

    @Override
    public void close() throws IOException {
        client.close(); // Drain application users before replacing/closing this owner.
    }
    // JVM HTTPS is opaque to a forwarding sidecar: HTTP retries/status ejection there
    // cannot be assumed. This example intentionally has no partner client certificate.
}
Physical DB pool ownership

Physical DB pool ownership

  • Resolve JNDI and physical pool ownership independently of WAR count. Include every replica and release generation in the DB session budget.
Oracle UCP acquisition and lifecycle examplejava
package example.obrh;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import oracle.ucp.jdbc.PoolDataSource;
import oracle.ucp.jdbc.PoolDataSourceFactory;

/** UCP API illustration. Reconcile an existing JNDI owner; don't create a duplicate pool. */
public final class UcpPoolExample {
    private UcpPoolExample() { }

    public static PoolDataSource configure(String jdbcUrl, String username, String password)
            throws SQLException {
        PoolDataSource pool = PoolDataSourceFactory.getPoolDataSource();
        pool.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
        pool.setURL(jdbcUrl); // Credentials supplied by approved secret handling.
        pool.setUser(username);
        pool.setPassword(password);
        pool.setConnectionPoolName("example-application-pool");
        pool.setInitialPoolSize(2);
        pool.setMinPoolSize(2);
        pool.setMaxPoolSize(12); // Illustrative per-physical-pool session allocation.
        pool.setConnectionWaitTimeout(1); // Seconds, wait for pool connection availability.
        pool.setValidateConnectionOnBorrow(true);
        pool.setSQLForValidateConnection("SELECT 1 FROM DUAL");
        return pool; // Application/container owner must manage shutdown/drain.
    }

    public static boolean readOnlyProbe(PoolDataSource pool) throws SQLException {
        // Borrow inside endpoint admission; no connection held while calling provider.
        try (Connection connection = pool.getConnection();
             PreparedStatement statement = connection.prepareStatement("SELECT 1 FROM DUAL")) {
            statement.setQueryTimeout(1); // Seconds; driver/database cancellation semantics.
            try (ResultSet rows = statement.executeQuery()) {
                return rows.next() && rows.getInt(1) == 1;
            }
        } // close() returns borrowed connection to pool, including exception paths.
    }
    // Pool wait is separate from physical login/connect, SQL, transaction and network
    // timeouts. Budget each against the remaining logical-request deadline.
    // This generic SELECT is NOT the existing OBRH DB/Camel health-check implementation.
}
Request execution and resource budgets

Request execution and resource budgets

Tomcat 9.0.122 standard platform-thread NIO model · illustrative budgets, not effective OBRH settings

Count the resource that can actually run out

Boundary Count Waiting / failure
OS accept backlog Connections awaiting acceptance Connect delay, refusal or timeout
Connector Accepted TCP sockets Includes idle keep-alive; not active business work
Request Executor Busy workers and queued Runnable tasks Wait for a worker; full queue can reject socket processing
Business admission Admitted logical operations Immediate policy rejection, or a separately bounded wait
HTTP client pool Leased connections / streams, plus acquisition waiters Provider-route pool can saturate while other workers are idle
DB pool Borrowed physical DB connections and acquisition waiters Session capacity and lock/SQL time remain separate
JVM / container CPU time, heap, native memory and deadline Throttling, GC, memory failure and expired useful work
  • These counts overlap. One synchronous operation can hold a worker, an admission permit and an HTTP lease at the same time. Adding their limits does not produce a request capacity.
  • HTTP pooling is a real capacity boundary; it is one resource within request execution. Pool size alone does not establish TPS.

Separate the design model from Current evidence

Connector and application limits

  • A representative Tomcat configuration allows 800 connections, 600 maximum request threads and 50 minimum spare threads. The launcher writes these settings into server.xml.

  • Check the effective Connector and its Executor. When a Connector references a shared Executor, that Executor owns the worker and task-queue limits.

  • The application executor has separate core, maximum and queue settings. Count its capacity only for paths that submit work to it. An offloaded call can occupy both a servlet worker and an application worker when the caller blocks for the result.

  • The Connector text rewrite can no-op when its exact prefix differs, or duplicate attributes on retained patched XML. Validate resulting XML and the selected Executor before interpreting those values.

  • The worked XML uses different values to illustrate a bounded queue. Measure the deployed worker occupancy and acquisition waits before choosing a limit.

Follow the owner before tuning

  • The map follows one application JVM in one functional domain. Direct and IL JVMs have separate local workers and clients unless actual ownership proves otherwise.
  • This is one phase-neutral mechanism map: there is no invented Current/Proposed difference. The bounded Executor XML and arithmetic are illustrative design inputs.
  • Select the queue or workers for the concrete Tomcat fragment; select business work for the lifetime rule; select HTTP/DB pools for their resource owners.
  • The lower budget objects explain how latency, CPU and replica overlap constrain the same path.
Request workers and Executor ownership

Request workers and Executor ownership

Tomcat 9.0.122 standard platform-thread NIO model · illustrative budgets, not effective OBRH settings

Configure the owner of the threads

  • This is a Service fragment for standalone Tomcat 9.0.122, with the existing Engine/Host intentionally omitted. Merge it into the real server.xml; it is not a complete replacement server.
  • The named StandardThreadExecutor owns maxThreads=80, minSpareThreads=20 and maxQueueSize=40. Declare it before the Connector.
  • Every Connector referencing requestWorkers competes for those same 80 workers and 40 queue slots. A second Connector does not get another independent allowance.
  • When a named Executor is referenced, Connector maxThreads and other thread-pool settings are ignored. Keep socket settings on each Connector.
Illustrative server.xml Service fragment: 80 shared workers, 40 queued tasksxml
<!-- Illustrative Tomcat 9.0.122 Service fragment, not an OBRH deployment.
     Merge the Executor and Connector into the existing Service in server.xml.
     Keep the existing Engine/Host, TLS, proxy and application configuration.
     Restart/activation and load validation are outside this documentation example.
     A standard platform-thread executor is shared by every Connector naming it.
     These values are sizing inputs, not measured safe limits. -->
<Service name="Catalina">
  <!-- Declare before Connectors. This object owns worker and task-queue limits. -->
  <Executor name="requestWorkers"
            className="org.apache.catalina.core.StandardThreadExecutor"
            namePrefix="request-worker-"
            maxThreads="80"
            minSpareThreads="20"
            maxQueueSize="40" />

  <!-- This object owns socket capacity and the requested OS listen backlog.
       Do not add maxThreads/maxQueueSize here: the referenced Executor owns them.
       connectionTimeout is not a business-operation deadline. -->
  <Connector port="8080"
             protocol="org.apache.coyote.http11.Http11NioProtocol"
             executor="requestWorkers"
             maxConnections="1000"
             acceptCount="100"
             connectionTimeout="5000"
             keepAliveTimeout="5000" />

  <!-- Existing Engine/Host configuration belongs here; intentionally omitted. -->
</Service>

Follow worker occupancy through a synchronous call

  • An accepted socket becomes eligible for processing through the NIO poller. A submitted socket-processing task runs on an Executor worker. An idle keep-alive socket does not permanently occupy a worker.
  • Parsing, authentication and application handling use execution capacity. A post-authentication admission gate has already consumed a request worker and pre-gate CPU; it cannot protect the accept backlog or erase parsing cost.
  • A synchronous HTTP-pool acquisition, provider read, DB acquisition or SQL call normally retains the servlet worker while blocked. CPU may be low while all request workers are busy.
  • Increasing maxThreads can hide blocking briefly while increasing stacks, scheduling and downstream contention. Measure thread states and acquisition wait before choosing that change.

An application executor is another boundary

  • A bounded business ThreadPoolExecutor is separate from the servlet Executor. Offloading then blocking on Future.get keeps the servlet worker and consumes business-executor capacity.
  • Servlet async can release the request worker after returning from dispatch; the continuation, request buffers and business permit remain until actual completion. Async does not create CPU or downstream capacity.
  • If adding a business executor, bound its queue, define explicit rejection and cancellation, propagate context deliberately, and own shutdown. CallerRunsPolicy can execute provider work on the submitting request worker and silently defeat the intended isolation.
  • The existing bounded-executor example belongs to the operation-isolation concern; it is not a replacement for this server.xml worker configuration.
Socket backlog and bounded task waiting

Socket backlog and bounded task waiting

Tomcat 9.0.122 standard platform-thread NIO model · illustrative budgets, not effective OBRH settings

Two queues with different units

  • acceptCount requests an OS listen-backlog bound. It concerns connections waiting for acceptance, subject to operating-system behavior. It is not a queue of authenticated API operations.
  • maxConnections concerns Connector connections, including keep-alive. A single connection can carry multiple requests over time; HTTP/2 streams further break any one-socket/one-request assumption.
  • maxQueueSize on the named Executor bounds queued Runnable tasks inside the JVM. Socket events and asynchronous redispatch mean a task is not universally a whole business request.

Understand the pool-growth and rejection path

  • Tomcat TaskQueue encourages pool growth toward maxThreads when existing workers cannot take submitted work; once the pool is at its limit, more tasks can queue. This is Tomcat-specific behavior.
  • The standard Executor default queue limit is Integer.MAX_VALUE. That is a theoretical element bound, not a useful small overload buffer or a preallocation of billions of tasks.
  • The fragment deliberately changes that queue to 40; no OBRH Current value is implied.
Illustrative bounded Executor and separate Connector socket settingsxml
<!-- Illustrative Tomcat 9.0.122 Service fragment, not an OBRH deployment.
     Merge the Executor and Connector into the existing Service in server.xml.
     Keep the existing Engine/Host, TLS, proxy and application configuration.
     Restart/activation and load validation are outside this documentation example.
     A standard platform-thread executor is shared by every Connector naming it.
     These values are sizing inputs, not measured safe limits. -->
<Service name="Catalina">
  <!-- Declare before Connectors. This object owns worker and task-queue limits. -->
  <Executor name="requestWorkers"
            className="org.apache.catalina.core.StandardThreadExecutor"
            namePrefix="request-worker-"
            maxThreads="80"
            minSpareThreads="20"
            maxQueueSize="40" />

  <!-- This object owns socket capacity and the requested OS listen backlog.
       Do not add maxThreads/maxQueueSize here: the referenced Executor owns them.
       connectionTimeout is not a business-operation deadline. -->
  <Connector port="8080"
             protocol="org.apache.coyote.http11.Http11NioProtocol"
             executor="requestWorkers"
             maxConnections="1000"
             acceptCount="100"
             connectionTimeout="5000"
             keepAliveTimeout="5000" />

  <!-- Existing Engine/Host configuration belongs here; intentionally omitted. -->
</Service>

Choose a wait that can still finish usefully

  • Estimate queue delay against remaining deadline, then test burst and tail behavior. More queue slots retain more request/socket state and can turn overload into slow timeouts.
  • Full Executor-queue rejection happens before an application response can necessarily be generated; socket closure/reset is possible. Do not advertise it as a guaranteed HTTP 503. An application admission gate can send a deliberate status once it is executing.
  • Queue capacity does not expire stale tasks automatically. Recheck deadline at application entry and before expensive acquisition; distinguish caller timeout from confirmed cancellation.
  • Reserve observable headroom for health checks, management traffic and completion/redispatch. A shared Executor offers no per-Connector reservation by itself.
Business admission and synchronous or async lifetime

Business admission and synchronous or async lifetime

Tomcat 9.0.122 standard platform-thread NIO model · illustrative budgets, not effective OBRH settings

Place admission honestly

  • The map places the illustrative nonblocking business gate after authentication, on a request worker. Rejected calls still spent connector, queue, parsing and authentication resources.
  • A proxy-side gate can shed earlier in a different process, but its counters and policy are not automatically the JVM business-operation counter.
  • A 64-permit JVM gate means at most 64 logical operations admitted by that gate while its permit is held. Separate endpoint gates or executors share the JVM CPU and any common HTTP/DB pools.
  • Use a bounded, explicitly budgeted admission wait only when it can finish within the caller deadline. A zero-wait gate sheds immediately; it does not consume another hidden application waiting queue.

Release at actual completion

Execution style Request worker Business permit / work
Synchronous provider/DB wait Retained while blocking Held until the logical operation completes
Offload then Future.get Still retained Also consumes offload worker or its queue
Servlet async / continuation Can return to request pool between dispatches Remains in flight; actual termination owns release
  • Release the permit exactly once when the admitted operation actually terminates, including terminal success, failure or rejection after admission. Timeout and cancellation paths must retain accounting for work that continues. A finally block around the initial servlet invocation is too short for work that outlives it.
  • A caller timeout or an accepted cancellation request does not prove provider work or a JDBC operation stopped. Track lingering work and pool release.

Match business and physical-resource limits

  • A permit bounds admitted operations, not simultaneous leased HTTP connections or DB sessions. Branches, retries and parallel fan-out can acquire several resources per operation.
  • HTTP pool maxTotal/per-route limits, lease timeout, connection/read timeout and response closure are separate controls. HTTP/2 stream concurrency requires protocol-specific accounting.
  • DB acquisition timeout, pool maximum, transaction duration, locks and session capacity need an independent budget.
  • Set a shared deadline and spend it across admission, executor wait, client-pool acquisition, remote I/O and response. Recheck what time remains before retrying. A Connector connectionTimeout does not supply this business deadline.
Worked occupancy, burst and slowdown example

Worked occupancy, burst and slowdown example

Tomcat 9.0.122 standard platform-thread NIO model · illustrative budgets, not effective OBRH settings

Declare the workload before doing arithmetic

  • Illustration only: one JVM, 240 requests/s, homogeneous synchronous calls, no retries, one concurrent HTTP/1.1 request per lease and one DB visit per request. Durations below are mean occupancy of each resource; they are not independent stages to add again.
  • Worker occupancy 250 ms includes 200 ms inside business admission plus pre/post-gate processing. HTTP lease 150 ms and DB borrow 25 ms occur within that work.
  • CPU service is 8 ms/request with four available core-equivalents; it excludes GC/background CPU. The separate 70% planning ceiling leaves room for overhead and variance, without proving that reserve sufficient.
  • Limits: 80 request workers, 64 business permits, 48 route connections, 12 DB connections and 40 waiting executor tasks. These illustrative limits agree with the Executor fragment; the other limits are planning inputs only.
Illustrative workload, limits and scenario inputs; no benchmark claimjson
{
  "kind": "illustrative-capacity-planning-inputs",
  "scope": "One JVM; homogeneous synchronous requests; one concurrent HTTP/1.1 request per lease and one DB visit per request; no retries; four available CPU core-equivalents; per-request CPU service excludes GC and background work",
  "measured": false,
  "targetArrivalRequestsPerSecond": 240,
  "limits": {
    "requestWorkers": 80,
    "executorWaitingTasks": 40,
    "businessInflight": 64,
    "httpRouteConnections": 48,
    "dbConnections": 12,
    "cpuCores": 4,
    "plannedCpuUtilizationFraction": 0.7,
    "callerDeadlineMs": 500
  },
  "meanOccupancyMs": {
    "requestWorker": 250,
    "businessInflight": 200,
    "httpLease": 150,
    "dbLease": 25,
    "cpuService": 8
  },
  "burst": {
    "arrivalRequestsPerSecond": 480,
    "assumedCompletionRequestsPerSecond": 320,
    "queueInitiallyEmpty": true,
    "assumedExecutorTasksPerRequest": 1
  },
  "slowProvider": {
    "httpLeaseMs": 550,
    "requestWorkerMs": 650,
    "businessInflightMs": 600
  },
  "replicaOverlap": {
    "oldJvms": 3,
    "newJvms": 3,
    "dbConnectionsPerJvm": 12
  },
  "limitsOfCalculation": [
    "Little's Law describes stable average populations; mean occupancy does not predict p99 queueing or safe TPS.",
    "Executor tasks include socket events and redispatch; one task per request is a burst-model simplification.",
    "Gate placement, HTTP protocol, pool ownership, traffic mix, CPU throttling and cancellation change the result.",
    "Queue capacity does not guarantee deadlines or explicit HTTP rejection.",
    "No workload, benchmark, installed Tomcat setting or live OBRH capacity is claimed."
  ]
}

Use average occupancy, then keep headroom

For a stable boundary, mean population = arrival rate × mean time held. Count acquisitions/attempts for that resource, including fan-out and retries.

Resource At 240 requests/s Illustrative limit Average occupancy
Request workers 240 × 0.250 = 60 80 75%
Business work 240 × 0.200 = 48 64 75%
HTTP leases 240 × 0.150 = 36 48 75%
DB leases 240 × 0.025 = 6 12 50%
CPU 240 × 0.008 = 1.92 core-seconds/s 4 cores 48% of physical CPU
  • Inverting those averages gives worker/business/HTTP ceilings of 320 requests/s and DB 480 requests/s. With an illustrative CPU planning ceiling of 70%, CPU allows 4 × 0.70 / 0.008 = 350 requests/s.
  • The smallest average ceiling is 320; it is not measured safe TPS. Variance, queueing, uneven routes, GC and scheduling make high-utilization tails worse. Target 240 leaves 25% of those three average limits unused; a tail-latency SLO still needs testing.

Evaluate the burst buffer against the deadline

  • Simplified burst model: arrivals jump to 480 requests/s, completions stay at 320/s, queue starts empty, and each request produces exactly one executor task. Real socket events/redispatch differ.
  • Backlog grows at 480 − 320 = 160 tasks/s. Forty slots fill in 40 / 160 = 0.25 s if this excess is sustained and admission does not shed earlier.
  • With no new arrivals and 320 completions/s, draining 40 tasks takes about 125 ms. If arrivals remain at 480/s, the backlog continues growing. The 125 ms fluid estimate for processing 40 tasks ahead is not a p99 wait or a per-request guarantee.
  • A 500 ms caller budget minus 250 ms base work and 125 ms queue wait leaves only 125 ms for network variation and other waits. A bigger queue can retain requests that can no longer finish.
  • Prefer deliberate early admission/rejection with a retry policy over unbounded waiting. Measure offered, admitted, completed and rejected rates separately.

Recalculate when the provider slows

  • If HTTP hold grows to 550 ms and worker/business occupancy grows to 650/600 ms, sustaining 240/s would need 132 HTTP leases, 156 workers and 144 permits. The original limits cannot support it.
  • At unchanged limits, the average ceilings fall to 48 / 0.550 ≈ 87 HTTP calls/s, 80 / 0.650 ≈ 123 request executions/s and 64 / 0.600 ≈ 107 admitted operations/s. The HTTP boundary becomes the first average bottleneck.
  • Expanding the request pool does not repair the provider. Deadline-aware shedding, provider recovery and safe retry ownership matter; a timeout does not instantly release remote work.
  • Async can reduce worker occupancy but leaves the HTTP hold and business in-flight problem.
CPU, memory, deadlines and replica overlap

CPU, memory, deadlines and replica overlap

Tomcat 9.0.122 standard platform-thread NIO model · illustrative budgets, not effective OBRH settings

Budget the whole JVM

  • Request workers, business executors, GC, health probes and client callbacks share CPU. A larger thread pool cannot create CPU quota; throttling can increase every occupancy time.
  • Account for native thread stacks, heap request bodies, queued tasks, connection buffers, TLS/native memory, response buffers and retained async state. Queues consume memory even when CPU is idle.
  • Bound body sizes and acquisition waits as well as counts. Avoid multiplying worst-case body size by a small count and calling that a complete heap estimate; object expansion, framework state and copies also matter.
  • A separate executor isolates scheduling slots, not heap, CPU, DB locks or a shared client manager.

Multiply physical owners across releases

  • For three old JVMs plus three new JVMs during release overlap, a distinct DB pool of 12 per JVM permits 6 × 12 = 72 sessions before other applications, maintenance or extra pools. Three steady JVMs would allow 36.
  • Count the actual physical pool owners, not WARs. Include Direct/IL runtimes, active/preview/draining replicas, sites, schedulers and retries according to the real deployment.
  • Local gates multiply too: six JVMs with 64 permits can admit up to 384 operations under evenly available capacity. A per-JVM gate is not a global provider quota.
  • Domain deployment separation contains local worker failure. A shared provider, database or storage system can still constrain multiple domains.

Validate the boundary that failed

Observation Discriminating evidence
Busy workers with low CPU Thread-state samples; provider/DB/pool waits
Growing task queue Executor owner, queue depth and age, dispatch/rejection counters
HTTP acquisition delay Actual manager/route lease counts and pending acquisition
DB acquisition delay Physical pool borrowed/waiters, transaction time, DB sessions/locks
Deadline failures after caller disconnect Lingering business operations and actual resource release
CPU pressure / GC / memory Container quota/throttling, allocation, retained bodies and async state
  • Test realistic arrival mix, provider latency, bursts, retries and release overlap. Record p95/p99, useful completions, rejects, queue age and resource occupancy together.
  • Raise a limit only after identifying its owner and the next bottleneck. The calculated example supplies a hypothesis and a test target; it does not certify production capacity.