Data Action Timeout on BYOC Trunk Status Query via REST API

Can anyone clarify the expected latency for querying trunk registration status via the /api/v2/trunking/trunks endpoint when managing 15 BYOC trunks across AP-SG and AP-NE regions? We are hitting a 504 Gateway Timeout on batch requests exceeding 500ms, despite our carrier failover logic remaining stable. This impacts our real-time analytics dashboard accuracy during peak load. Any insights on rate limiting or optimization strategies?

Thanks for the help.

Check your request batching strategy. The /api/v2/trunking/trunks endpoint returns a list, but querying specific trunk details concurrently for 15 trunks across multiple regions can trigger rate limits or timeout on the gateway if not handled correctly. Instead of individual calls, fetch the full trunk list once, then filter client-side. If you need real-time registration status, consider using the WebSocket event stream for trunks:status changes rather than polling REST. Here is a simple JMeter logic snippet for efficient polling:

// Pseudo-code for JMeter BeanShell
String trunkId = vars.get("trunkId");
if (trunkId == null) {
 // Fetch all trunks once
 sampler.setPath("/api/v2/trunking/trunks");
} else {
 // Use cached data or WebSocket event
 log.info("Using cached status for " + trunkId);
}

Also, ensure your client-side timeout is set higher than 500ms for initial bulk fetches. AP-NE often has higher latency.