Menu

Every deploy gave a full share of traffic to JVMs that had not compiled anything yet
📰

Every deploy gave a full share of traffic to JVMs that had not compiled anything yet

DEV Community: java·Sergey Shinder·19 days ago
#uYYb5cRj
#devtojava#devto#dev#shop#timeout
Long article (354 words) — no AI summary yet.
Reading 0:00
15s threshold

Our stock lookup service answers in about twelve milliseconds at the ninety ninth percentile, and the shop calls it with a timeout of two hundred and fifty. It runs as eight pods behind an Application Load Balancer that sends traffic straight to the pods. For a year, every deploy produced a small burst of timeouts in the shop: a few hundred failed lookups, products shown as unavailable for a minute, then nothing. We had filed it under deploys being a bit noisy.

In October we started deploying several times a day, and the bursts became a visible share of the shop's errors, so I looked properly. Every timeout came from a new pod, in its first forty to sixty seconds.

A JVM starts by interpreting bytecode. Methods that run often get compiled, quickly by the C1 compiler first and later, after many more invocations, into optimised code by C2. Until the hot paths are compiled, a request costs many times what it will cost a minute later, and class loading and the first database connections add to it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.