@colyseus/tools 0.15.5 → 0.15.6

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/system-boot.js +6 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colyseus/tools",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "description": "Colyseus Tools for Production",
5
5
  "input": "./src/index.ts",
6
6
  "main": "./build/index.js",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "b437177e499a0f156e2eb8e5b65bc94bf0344a46"
51
+ "gitHead": "b3760cb73b3cf380c05b8a50a2ea5545c4a72e2f"
52
52
  }
package/system-boot.js CHANGED
@@ -21,11 +21,12 @@ function bailOnErr(err) {
21
21
  function updateNOFileConfig(cb) {
22
22
  // const numCPU = os.cpus().length;
23
23
  const totalmemMB = os.totalmem() / 1024 / 1024;
24
- const estimatedCCUPerGB = 4000;
24
+ const estimatedCCUPerGB = 5000;
25
25
 
26
26
  const maxCCU = Math.floor((totalmemMB / 1024) * estimatedCCUPerGB);
27
- const systemMaxNOFileLimit = maxCCU * 4;
28
- const nginxMaxNOFileLimit = maxCCU * 3; // 3x because of nginx -> proxy_pass -> node:port
27
+ const workerConnections = maxCCU * 2; // 2x because of proxy_pass
28
+ const nginxMaxNOFileLimit = workerConnections * 2; // 2x
29
+ const systemMaxNOFileLimit = workerConnections * 3; // 3x for other system operations
29
30
 
30
31
  // immediatelly apply new nofile limit
31
32
  // (apparently this has no effect)
@@ -41,11 +42,11 @@ function updateNOFileConfig(cb) {
41
42
  worker_rlimit_nofile ${nginxMaxNOFileLimit};
42
43
 
43
44
  events {
44
- worker_connections ${maxCCU};
45
+ worker_connections ${workerConnections};
45
46
  # multi_accept on;
46
47
  }
47
48
  `, cb);
48
- console.log("new nofile limit:", { maxCCU, systemMaxNOFileLimit, nginxMaxNOFileLimit });
49
+ console.log("new nofile limit:", { workerConnections, systemMaxNOFileLimit, nginxMaxNOFileLimit });
49
50
 
50
51
  } else {
51
52
  console.warn(NGINX_LIMITS_CONFIG_FILE, "not found.");