J
J
jasonOk2017-04-21 20:13:03
PHP
jasonOk, 2017-04-21 20:13:03

Why are there too many connections to mongodb?

I'm using MongoClient PHP, everything worked fine until today, at one point I started getting the error
No suitable servers found (`serverSelectionTryOnce` set): [Server closed connection. calling ismaster on XX.XXX.XXX.XXX:27027]
Errors in mongodb logs:

2017-04-21T18:35:11.407+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:11.987+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:12.593+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:13.173+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:13.752+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:14.359+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:14.969+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819
2017-04-21T18:35:15.578+0200 I NETWORK  [initandlisten] connection refused because too many open connections: 819

How can this happen? Is it possible to increase the connection limit?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
emp1re, 2017-04-21
@emp1re

each connection occupies 1 MB of memory, the system allocates approximately 80% of the memory to the connection pool, a total of 819 simultaneous connections is the maximum for a server with 1 GB of memory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question