@colyseus/tools 0.15.2 → 0.15.3
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 +2 -2
- package/system-boot.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@colyseus/tools",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3",
|
|
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": "
|
|
51
|
+
"gitHead": "3d22fe71a30b78158450f79d091a24ef80494d2c"
|
|
52
52
|
}
|
package/system-boot.js
CHANGED
|
@@ -23,16 +23,17 @@ function updateNOFileConfig(cb) {
|
|
|
23
23
|
const totalmemMB = os.totalmem() / 1024 / 1024;
|
|
24
24
|
const estimatedCCUPerGB = 4000;
|
|
25
25
|
|
|
26
|
-
const maxCCU = (totalmemMB / 1024) * estimatedCCUPerGB;
|
|
26
|
+
const maxCCU = Math.floor((totalmemMB / 1024) * estimatedCCUPerGB);
|
|
27
27
|
const systemMaxNOFileLimit = maxCCU * 4;
|
|
28
28
|
const nginxMaxNOFileLimit = maxCCU * 3; // 3x because of nginx -> proxy_pass -> node:port
|
|
29
29
|
|
|
30
30
|
// immediatelly apply new nofile limit
|
|
31
|
+
// (apparently this has no effect)
|
|
31
32
|
exec(`ulimit -n ${systemMaxNOFileLimit}`, bailOnErr);
|
|
32
33
|
|
|
33
34
|
// update "/etc/security/limits.conf" file.
|
|
34
35
|
fs.writeFileSync(LIMITS_CONF_FILE, `
|
|
35
|
-
* - nofile $
|
|
36
|
+
* - nofile ${systemMaxNOFileLimit}
|
|
36
37
|
`, bailOnErr);
|
|
37
38
|
|
|
38
39
|
if (fs.existsSync(NGINX_LIMITS_CONFIG_FILE)) {
|