Let's say I have an android mobile application, opening a GRPC/HTTP2 stream to a server, and willing to keep this stream open all over the day (assuming the mobile device is kept on). This connection goes through multiple network equipment (VPN, FW, LB, WAF and proxy).
Problem: After connection is set up, it is closed after 60 sec. After some investigation, I noticed that the WAF (Apache httpd) that was closing the connection after 60 sec. I set the "Timeout" and "ProxyTimeout" to 600, which improved the situation and make my connection last 10 mn.
I’m wondering if the issue is on application of network infrastructure.
Questions:
- Am I supposed to set all timeout of all my network equipment to such higher value (like 12 hours to maintain connection through all day ?). What are the good practice for network equipment timeout ?
- Is there a problem on my mobile application ? Is it supposed to resume/reconnect automatically ?
- Shouldn’t be handled by GRPC stack itself ?
Look into gRPC Keepalive. From my experience the standard way is to send frequent keepalive pings in an established gRPC stream to keep it up.