Answer the question
In order to leave comments, you need to log in
Increase tcp connection limit for websocket?
Used by workerman for websocket. The maximum number of connections is 1024 or sometimes 1090 connects. OS ubuntu.
Tried changing ubuntu open files limit and other settings. It's still some kind of limit.
Did the same as written on stackoverflow
https://stackoverflow.com/questions/410616/increas... .
Rebooted the server and the settings are reset.
If you do not restart the server, the settings remain, but do not affect anything.
ruvds hosting.
1 core
1 gb ram
1000 connections take approximately 8 mb.
So far, messages are not sent to the client and from the client to the server. I'm trying to remove the limits. That is, there is no load on the server, just connections.
Added:
Settings in /etc/security/limits.conf
#* soft core 0
#root hard core 100000
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#ftp - chroot /ftp
#@student - maxlogins 4
* soft nofile 10000000
* hard nofile 10000000
root soft nofile 10000000
root hard nofile 10000000
# End of file
Answer the question
In order to leave comments, you need to log in
var async = require('async');
var mysqlConnect = ... //
var AT_THE_SAME_TIME_LIMIT = 3; // лимит количества одновременных асинхронных обработок.
async.mapLimit(['13', 'dsd', '432'], AT_THE_SAME_TIME_LIMIT, function iterator (id, cb) {
mysqlConnect.query("SELECT * FROM `lala` WHERE `id`=?", [id], function (err, result) {
cb(err, result);
});
}, function final (err, results) {
if (err) throw new Error(err);
console.log(results);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question