U
U
ugin_root2014-06-14 00:35:53
MySQL
ugin_root, 2014-06-14 00:35:53

Nodejs+mysql(node-mysql), 2000+ requests per second, "Error: read ECONNRESET" error after 5-40 minutes

0. Nodejs+mysql( https://github.com/felixge/node-mysql)
1. Cluster. Number of threads = number of processors + 1 (the master executes queries very rarely)
2. The number of queries per thread is approximately 500 per second
3. The total number of queries is approximately 2000 per second (depending on the number of processors)
4. Windows 8.1 + mysql(5.1 .41)
5. The first 5 - 40 minutes the application works as expected
6. The error occurs on table update queries
7. Queries are very fat VARCHAR(10) + MEDIUMTEXT (from 1 to ~16Mb)
8. All queries are bold, the error always occurs on different
9. Error text "Error: read ECONNRESET"
And finally the question,What is the problem and what can I do to make it go away?
PS: I understand that the server itself closes the connection, but I don’t understand what to do with it. There is an option to create new connections, but this is more like a crutch, not a solution.
UPD: Threads "die" one at a time. The latter "lives" longer than the others.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
ugin_root, 2014-06-14
@ugin_root

The pools ended up dropping too. I managed to solve the problem by simply increasing "max_allowed_packet" and "query_alloc_block_size" to 20 MB, the problem disappeared.
PS: I forgot that this is a heavy application and that I have default mysql settings at home, I sinned on Windows, because. Everything worked fine on Ubuntu.

A
Andrey Yelpaev, 2014-06-14
@andreyelpaev

Tried to work through Pool?

var pool  = mysql.createPool({
  host     : 'example.org',
  user     : 'bob',
  password : 'secret'
});

pool.getConnection(function(err, connection) {
   connection.query( 'SELECT something FROM sometable', function(err, rows) {
        connection.release(); 
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question