Twan07 commited on
Commit
aeeba05
·
verified ·
1 Parent(s): 3860e99

Update start.sh

Browse files
Files changed (1) hide show
  1. start.sh +20 -1
start.sh CHANGED
@@ -17,4 +17,23 @@ sudo sh -c 'echo -e "nameserver 1.1.1.1\nnameserver 8.8.8.8" > /etc/resolv.conf'
17
  cat /etc/resolv.conf
18
 
19
 
20
- node index
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  cat /etc/resolv.conf
18
 
19
 
20
+ NODE_OPTIONS="
21
+ --max-old-space-size=4096
22
+ --max-semi-space-size=1024
23
+ --initial-old-space-size=2048
24
+ --expose-gc
25
+ "
26
+
27
+ # OS-level tuning (Linux)
28
+ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
29
+ # Increase socket buffer sizes
30
+ sysctl -w net.core.rmem_max=134217728
31
+ sysctl -w net.core.wmem_max=134217728
32
+ sysctl -w net.ipv4.tcp_rmem="4096 87380 134217728"
33
+ sysctl -w net.ipv4.tcp_wmem="4096 65536 134217728"
34
+ fi
35
+
36
+ # Run server
37
+ export NODE_OPTIONS="$NODE_OPTIONS"
38
+ export NODE_ENV=production
39
+ node --enable-source-maps index.js