Skip to content

Response Timing ​

Every /rpc response includes a timing object that breaks down where time was spent. Use it to diagnose latency and understand the full round-trip cost of a request.

TIP

All timings are in milliseconds (ms). 1000 ms = 1 second, so a 200 ms response is 0.2 s.

json
{
  "ok": true,
  "requestId": null,
  "result": "hello",
  "error": null,
  "timing": {
    "decryptMs": 1,
    "connectMs": 0,
    "execMs": 9,
    "proxyMs": 10
  }
}

Fields ​

FieldMeasured atWhat it captures
decryptMsProxy nodeTime to decrypt the encrypted service credentials that the gateway sent. Includes the AES-GCM operation. Normally < 4 ms.
connectMsProxy nodeTime to acquire a connection from the per-service connection pool. 0 ms means a pooled connection was reused immediately. A non-zero value means the pool was empty and a new TCP connection had to be opened to your database.
execMsProxy nodeTime to run the actual command against your database and receive the result. This is pure database + network time between the proxy node and your database host.
proxyMsProxy nodeTotal wall-clock time spent inside the proxy node for this request. Equals roughly decryptMs + connectMs + execMs plus a small internal overhead (JSON encoding, etc).

How to read total latency ​

A request travels through two hops:

Client β†’ [gateway] β†’ [proxy node] β†’ [your database]
          └─ gateway stages β”€β”˜   └─ node timing β”€β”€β”˜
  • proxyMs β€” the node's share of the round-trip (decrypt + connect + exec).
  • Gateway overhead β€” everything else: API key auth, signature verification, request routing, and JWT signing before the request reaches the node.
  • Network β€” transit between clientβ†’gateway and gatewayβ†’node is not directly measured but is totalMs βˆ’ gatewayOverhead βˆ’ proxyMs.

Optimising ​

connectMs is highYour connection pool is cold or undersized. Reuse the zedgi client across requests (module-level singleton) so the pool stays warm.
execMs is highThe query itself is slow. Add an index or optimise the SQL.
decryptMs > 5 msRare; indicates CPU pressure on the proxy node.
Total > 500 ms but proxyMs < 50 msLatency is in the gateway or network rather than your database.