I'm working on a new kind of proxy server using node.js. With cluster module I'm able to fork the process (which are double the number of cores). The server configuration is 8GB RAM, 8 core Intel (Xeon) processors and has bandwidth limit of 500 MB per month and it is Ubuntu Precise Machine. However not all the bandwidth we are able to use. What our users are using is only 30MB daily. We want our users to use full bandwidth, but they are not able to use and also even at 30 MB limit the speed is slow, because of node.js server is restarting every 10 minutes (average time) because of sockets hanging.
Sockets are hanging because of some uncaught exceptions in node.js and node.js tends not to respond and goes to infinite loop, then one of the cluster process dies and I see the count of clusters (everything is good at 16 processes), if the number of processes of node.js falls to 14, there is cronjob, which kills entire node.js and restarts the entire proxy script.
I have modified sysctl.conf and also limits.conf. Here are those files (sysctl.conf) http://pastebin.com/6Unvgayc and limits.conf http://pastebin.com/daLiSsYr, Please suggest me if I'm wrong in these settings. I'm new to bandwidth tuning of linux servers, please let me know, if I'm doing or missing anything
Thank You Sai