@@ -188,14 +188,24 @@ def start(self):
188188 channel_options = [
189189 ("grpc.max_receive_message_length" , - 1 ),
190190 ("grpc.max_send_message_length" , - 1 ),
191- ("grpc.keepalive_time_ms" ,
192- 120000 ), # Increased to 120s to further reduce ping frequency
193- ("grpc.keepalive_timeout_ms" , 300000 ),
191+ # Default: 30000ms (30s), increased to 180s to reduce ping frequency
192+ ("grpc.keepalive_time_ms" , 180000 ),
193+ # Default: 5000ms (5s), increased to 10 minutes for stability
194+ ("grpc.keepalive_timeout_ms" , 600000 ),
195+ # Default: 2, set to 0 to allow unlimited pings without data
194196 ("grpc.http2.max_pings_without_data" , 0 ),
197+ # Default: False, set to True to allow keepalive pings when no calls
195198 ("grpc.keepalive_permit_without_calls" , True ),
196- ("grpc.http2.min_recv_ping_interval_without_data_ms" , 300000 ),
197- ("grpc.http2.min_sent_ping_interval_without_data_ms" ,
198- 60000 ), # Increased to 60s to be more conservative
199+ # Default: 300000ms (5min), increased to 10min for stability
200+ ("grpc.http2.min_recv_ping_interval_without_data_ms" , 600000 ),
201+ # Default: 300000ms (5min), increased to 120s for conservative pings
202+ ("grpc.http2.min_sent_ping_interval_without_data_ms" , 120000 ),
203+ # Default: 2, set to 0 to allow unlimited ping strikes
204+ ("grpc.http2.max_ping_strikes" , 0 ),
205+ # Default: 0 (disabled), enable socket reuse for better handling
206+ ("grpc.so_reuseport" , 1 ),
207+ # Default: 0 (disabled), set 30s TCP timeout for connection control
208+ ("grpc.tcp_user_timeout_ms" , 30000 ),
199209 ]
200210 self ._grpc_channel = grpc .insecure_channel (
201211 endpoint , options = channel_options )
0 commit comments