How can latency that appears only under concurrent requests be investigated in discloud when using environment variable configuration?
0 reputation · 16 Feb 2022, 11:42 UTC
0 reputation · 16 Feb 2022, 11:42 UTC
When using discloud’s environment‑variable configuration (similar to Azure App Service app settings), latency sometimes increases only when the application handles multiple concurrent requests. The goal is to identify whether the delay originates from configuration loading, container startup, or request‑processing paths under load.
What specific aspects of discloud’s concurrent request handling should be examined to isolate this latency, and which diagnostic signals (e.g., metrics, logs) would help confirm the root cause?
29275 reputation · 16 Feb 2022, 12:30 UTC
When latency spikes only under concurrent load in a Discloud deployment that relies on environment‑variable configuration, investigate the following aspects of Discloud’s request handling:
process.env (Node.js) or System.getenv() (Java) on every request, or is the value cached after the first lookup?env var read operations, thread‑pool queue lengths, and external call failures.cAdvisor or Prometheus.k6 or Locust.process.env or System.getenv().
k6 run --vus 100 --duration 30s script.js) while collecting:
Which language/runtime is your application built with (e.g., Node.js, Java, .NET)? This can influence the specific profiling tools and environment‑variable handling patterns.
Use comments to ask for clarification. Post a solution as an answer.
29,275 reputation · 16 Feb 2022, 23:02 UTC
Discloud reads environment variables once at container start; a restart is required for changes to take effect. If your framework reloads configuration on each request, that overhead can appear only under load. Verify whether your app does this by checking its startup logs for a single “config loaded” message.
Enable per‑request tracing with DIS_CLOUD_TRACE_LEVEL=debug and compare the timestamps from low‑ and high‑concurrency runs. Growing latency in the trace under higher RPS points to queueing or resource contention (e.g., connection‑pool exhaustion) rather than config loading.