Skip to content

Commit a4ce68d

Browse files
authored
fix(wsproxy): increase socket timeout and enable keepalive (#4808)
1 parent 144e13c commit a4ce68d

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/wsproxy/lib/backend.ai-ws-appproxy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ module.exports = proxy = class Proxy extends ai.backend.Client {
131131
logger.info(
132132
`App-Proxy server connection established: ${this.ip}:${this.port}.`,
133133
);
134-
tcpConn.setTimeout(60000);
134+
tcpConn.setTimeout(3600000);
135+
tcpConn.setKeepAlive(true, 30000);
135136
tcpConn.on('timeout', () => {
136137
logger.debug(`Socket timeout`);
137138
tcpConn.destroy();

src/wsproxy/lib/console-appproxy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ module.exports = proxy = class Proxy {
116116
logger.info(
117117
`App-proxy server connection established: ${this.ip}:${this.port}.`,
118118
);
119-
tcpConn.setTimeout(30000);
119+
tcpConn.setTimeout(3600000);
120+
tcpConn.setKeepAlive(true, 30000);
120121
tcpConn.on('timeout', () => {
121122
logger.debug(`Socket timeout`);
122123
tcpConn.destroy();

0 commit comments

Comments
 (0)