我正在使用 Node.Js v0.10.2 并在循环中处理大约500个链接。 http请求卡住了,我可以随时看到一滴带宽。
在我的100mbit专用服务器上,我只有~4500KB/s throughput。在64 mbit连接的家用计算机上,吞吐量仅为1500KB / s。我使用slurm
进行吞吐量测量。
我在 16gb ram 上使用 i7 2600 运行 debian 6 。
我也尝试了不同的代理配置并试用了Connection:Close / Keep-Alive,但仍然没有改进。
我真的不知道它缺乏的地方......
/etc/sysctl.conf中:
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.ipv4.tcp_rmem = 4096 16384 33554432
net.ipv4.tcp_wmem = 4096 16384 33554432
net.ipv4.tcp_mem = 786432 1048576 26777216
net.ipv4.tcp_max_tw_buckets = 360000
net.core.netdev_max_backlog = 2500
vm.min_free_kbytes = 65536
vm.swappiness = 0
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn = 35000
net.core.netdev_max_backlog = 32000
net.ipv4.tcp_max_syn_backlog = 64000
fs.file-max = 1000000
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 127906
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 99999
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 127906
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited