@andersbakken/fisk 3.5.3 → 3.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andersbakken/fisk",
3
- "version": "3.5.3",
3
+ "version": "3.5.4",
4
4
  "description": "Fisk, a distributed compile system",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -101,7 +101,14 @@ class Server extends EventEmitter {
101
101
  this.server = http.createServer(this.app);
102
102
  this.ws = new WebSocket.Server({ noServer: true });
103
103
  const port = this.option.int("port", 8097);
104
- this.server.listen({ port: port, backlog: this.option.int("backlog", 1024), host: "0.0.0.0" });
104
+ let defaultBacklog = 128;
105
+ try {
106
+ defaultBacklog = parseInt(fs.readFileSync("/proc/sys/net/core/somaxconn", "utf8")) || 128;
107
+ } catch () {
108
+ }
109
+
110
+ let backlog = this.option.int("backlog", defaultBacklog);
111
+ this.server.listen({ port, backlog, host: "0.0.0.0" });
105
112
 
106
113
  this.server.on("upgrade", (req, socket, head) => {
107
114
  this.ws.handleUpgrade(req, socket, head, (ws) => {