gRPC Java server returns HTTP/2 GOAWAY under sustained concurrency when keepalive_time is less than proxy idle timeout
Environment
Java gRPC server (grpc-java 1.56) deployed behind an L7 proxy (NGINX) that enforces upstream idle timeout of 60s. Server sets keepalive_time to 30s and keepalive_permit_without_calls true to detect dead peers quickly.
Symptoms
Under high concurrent RPC load, clients intermittently see HTTP/2 GOAWAY from the server and stream resets; server logs show abrupt connection termination timed around proxy idles. Failures clustered when RPCs extend beyond 60s or when many concurrent idle connections exist.
Observations
GOAWAY contains debug data pointing at 'ENHANCE_YOUR_CALM' or generic shutdown. tcpdump shows periodic HTTP/2 PINGs from server at 30s intervals and then proxy cutting connection at 60s, which causes server-side connection error handling to send GOAWAY. Reducing keepalive reduces visibility of dead clients but avoids GOAWAYs.
Already attempted
Increased proxy idle timeout to 120s — GOAWAY incidents stopped. Also tried disabling keepalive pings on server — reduced GOAWAY but delayed detection of dead clients. Upgrading grpc-java to latest minor release had no effect.
Question
Why do gRPC Java servers emit GOAWAY when server keepalive pings are more frequent than proxy idle timeout, and what's the safe configuration to avoid GOAWAYs without sacrificing dead-client detection?
Verified community troubleshooting
The server was pinging more frequently than the proxy's idle window, so the proxy closed TCP while the server was still active — grpc-java then emits GOAWAY. Fix by matching intervals: set keepalive_time >= proxy idle timeout (or increase the proxy timeout). Alternatively turn off keepalives without active RPCs (keepalive_permit_without_calls=false). After changing, confirm with packet capture that server PINGs no longer precede a proxy close and run your concurrency test to validate.
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Programming33% match
Go gRPC server returns HTTP/2 GOAWAY under high concurrent RPCs — client sees stream resets
Open0 answers - Web Development29% match
Next.js serverless API on Vercel returns intermittent 504s for long upstream requests when HTTP keep-alive sockets are exhausted
Open0 answers - Web Development28% match
Next.js serverless API returns 502 for large Transfer-Encoding: chunked uploads only when behind NGINX reverse proxy
Open0 answers - Web Development27% match
Nginx returns 504 Gateway Timeout only for backend requests over ~45s to my Node API
Open1 answer - Servers24% match
NGINX reloads during certificate rotation cause intermittent 503/HTTP2 stream resets under load
Open1 answer