Skip to content

Commit

Permalink
Remove CWMP_KEEP_ALIVE_TIMEOUT
Browse files Browse the repository at this point in the history
This turned out not to be necessary. Will use SESSION_TIMEOUT for
connection timeout.
  • Loading branch information
zaidka committed Sep 6, 2019
1 parent b5efe6c commit 6f0e1d6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
4 changes: 1 addition & 3 deletions bin/genieacs-cwmp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ if (!cluster.worker) {
cert: config.get("CWMP_SSL_CERT")
};

const keepAliveTimeout = config.get("CWMP_KEEP_ALIVE_TIMEOUT") as number;

process.on("uncaughtException", err => {
if ((err as NodeJS.ErrnoException).code === "ERR_IPC_DISCONNECTED") return;
logger.error({
Expand Down Expand Up @@ -118,7 +116,7 @@ if (!cluster.worker) {
ssl,
cwmp.listener,
cwmp.onConnection,
keepAliveTimeout
0
);
})
.catch(err => {
Expand Down
10 changes: 0 additions & 10 deletions docs/environment-variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ CWMP_ACCESS_LOG_FILE

Default: unest

CWMP_KEEP_ALIVE_TIMEOUT
How long (in milliseconds) to maintain an open TCP connection while waiting
for the CPE to send the next HTTP request. If a CPE takes longer to respond
the server will terminate the TCP connection and store the session details
temporarily in the DB cache. This results in a performance hit. Adjust this
for better performance if your devices often take longer than 5 seconds to
respond.

Default: ``5000`` (Node's default)

NBI_WORKER_PROCESSES
The number of worker processes to spawn for genieacs-nbi. A value of 0 means
as many as there are CPU cores available.
Expand Down
1 change: 0 additions & 1 deletion lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const options = {
CWMP_SSL_KEY: { type: "string", default: "" },
CWMP_LOG_FILE: { type: "path", default: "" },
CWMP_ACCESS_LOG_FILE: { type: "path", default: "" },
CWMP_KEEP_ALIVE_TIMEOUT: { type: "int", default: 0 },

NBI_WORKER_PROCESSES: { type: "int", default: 0 },
NBI_PORT: { type: "int", default: 7557 },
Expand Down
4 changes: 2 additions & 2 deletions lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function start(
ssl,
_listener,
onConnection?,
keepAliveTimeout: number = 0
keepAliveTimeout: number = -1
): void {
listener = _listener;

Expand All @@ -77,7 +77,7 @@ export function start(
if (onConnection != null) server.on("connection", onConnection);
}

if (keepAliveTimeout) server.keepAliveTimeout = keepAliveTimeout;
if (keepAliveTimeout >= 0) server.keepAliveTimeout = keepAliveTimeout;
server.listen(port, networkInterface);
}

Expand Down

0 comments on commit 6f0e1d6

Please sign in to comment.