MongoDB - The connection is not disconnected for a long time
up vote
0
down vote
favorite
I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB,
The MongoDB connection pool of the server of the web site became MAX and it ceased to MongoDB from the web site.
The MongoDB service is configured with the following configuration.
mongos server#1 service:mongos、config
mongos server#2 service:mongos、config、rs01arbiter
mongos server#3 service:mongos、config、rs02arbiter
node#1 service:rs01(secondary)、rs02(secondary)
node#2 service:rs01(primary)、rs02(primary)
※Originally the following state is set, but OS is restarted, primary has dropped to node # 2, but it is left as it is
node#1 service:rs01(primary)、rs02(secondary)
node#2 service:rs01(secondary)、rs02(primary)
From this state, we restarted the OS of node # 2.
rs 01 and rs 02 of node # 1 were promoted to primary. rs01, rs02 of node # 2 demoted to secondary.I confirmed it from the log.
However, it happened that more connections would take more than 1 to 2 hours from OS reboot on node # 2 to expire.
And the MongoDB connection pool of the server of the web site became MAX and it became not connected to MongoDB from the web site.
Normally it will be out of connection in about 30 minutes at the longest.
I thought that node # 1 works as Primary, so I thought it would work normally, but I do not know why the connection is not disconnected for a long time.
If you encounter similar events, please let me know if anyone knows the solution or workaround.
mongodb
add a comment |
up vote
0
down vote
favorite
I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB,
The MongoDB connection pool of the server of the web site became MAX and it ceased to MongoDB from the web site.
The MongoDB service is configured with the following configuration.
mongos server#1 service:mongos、config
mongos server#2 service:mongos、config、rs01arbiter
mongos server#3 service:mongos、config、rs02arbiter
node#1 service:rs01(secondary)、rs02(secondary)
node#2 service:rs01(primary)、rs02(primary)
※Originally the following state is set, but OS is restarted, primary has dropped to node # 2, but it is left as it is
node#1 service:rs01(primary)、rs02(secondary)
node#2 service:rs01(secondary)、rs02(primary)
From this state, we restarted the OS of node # 2.
rs 01 and rs 02 of node # 1 were promoted to primary. rs01, rs02 of node # 2 demoted to secondary.I confirmed it from the log.
However, it happened that more connections would take more than 1 to 2 hours from OS reboot on node # 2 to expire.
And the MongoDB connection pool of the server of the web site became MAX and it became not connected to MongoDB from the web site.
Normally it will be out of connection in about 30 minutes at the longest.
I thought that node # 1 works as Primary, so I thought it would work normally, but I do not know why the connection is not disconnected for a long time.
If you encounter similar events, please let me know if anyone knows the solution or workaround.
mongodb
It would be helpful to specify the mongoDB version. Also check if you are using keepAlive on the connection. What is your connection pool setting?
– Akrion
Nov 8 at 5:00
Thanks for the advice. The version of MongoDB is "MongoDB 3.0.12". The application connected to MongoDB is built with .net c # and is running on Windows Server 2012 R2. TCP Keepalive remains the default setting. Also when connecting from application socketOptions.keepAlive has not changed. The connectionString of the application also does not set the option as follows. <add name="config" connectionString="mongodb://user:pass@mongos1:27017,mongos2:27017,mongos3:27017/config"/>
– m.kawasaki
Nov 8 at 5:25
What is the default setting forkeepAlive
on that mongoDB version? Can you try to disable it? I assume your connection pool is 5 if using the node mongoDB driver etc.
– Akrion
Nov 8 at 5:30
I examined KeepAlive, but it was not found in ConnectionString's Option, nor was it found on the source code of MongoDB.Driver.dll (version 1.10.0.62). How do I know if you are using KeepAlive or not?
– m.kawasaki
Nov 9 at 2:11
From the connection source application, I am connecting to MongoDB with the C # .NET driver (MongoDB.Driver.dll (version 1.10.0.62)).
– m.kawasaki
Nov 9 at 2:42
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB,
The MongoDB connection pool of the server of the web site became MAX and it ceased to MongoDB from the web site.
The MongoDB service is configured with the following configuration.
mongos server#1 service:mongos、config
mongos server#2 service:mongos、config、rs01arbiter
mongos server#3 service:mongos、config、rs02arbiter
node#1 service:rs01(secondary)、rs02(secondary)
node#2 service:rs01(primary)、rs02(primary)
※Originally the following state is set, but OS is restarted, primary has dropped to node # 2, but it is left as it is
node#1 service:rs01(primary)、rs02(secondary)
node#2 service:rs01(secondary)、rs02(primary)
From this state, we restarted the OS of node # 2.
rs 01 and rs 02 of node # 1 were promoted to primary. rs01, rs02 of node # 2 demoted to secondary.I confirmed it from the log.
However, it happened that more connections would take more than 1 to 2 hours from OS reboot on node # 2 to expire.
And the MongoDB connection pool of the server of the web site became MAX and it became not connected to MongoDB from the web site.
Normally it will be out of connection in about 30 minutes at the longest.
I thought that node # 1 works as Primary, so I thought it would work normally, but I do not know why the connection is not disconnected for a long time.
If you encounter similar events, please let me know if anyone knows the solution or workaround.
mongodb
I am building a system that outputs information such as visit information and page transition of the user who visited the website to MongoDB,
The MongoDB connection pool of the server of the web site became MAX and it ceased to MongoDB from the web site.
The MongoDB service is configured with the following configuration.
mongos server#1 service:mongos、config
mongos server#2 service:mongos、config、rs01arbiter
mongos server#3 service:mongos、config、rs02arbiter
node#1 service:rs01(secondary)、rs02(secondary)
node#2 service:rs01(primary)、rs02(primary)
※Originally the following state is set, but OS is restarted, primary has dropped to node # 2, but it is left as it is
node#1 service:rs01(primary)、rs02(secondary)
node#2 service:rs01(secondary)、rs02(primary)
From this state, we restarted the OS of node # 2.
rs 01 and rs 02 of node # 1 were promoted to primary. rs01, rs02 of node # 2 demoted to secondary.I confirmed it from the log.
However, it happened that more connections would take more than 1 to 2 hours from OS reboot on node # 2 to expire.
And the MongoDB connection pool of the server of the web site became MAX and it became not connected to MongoDB from the web site.
Normally it will be out of connection in about 30 minutes at the longest.
I thought that node # 1 works as Primary, so I thought it would work normally, but I do not know why the connection is not disconnected for a long time.
If you encounter similar events, please let me know if anyone knows the solution or workaround.
mongodb
mongodb
asked Nov 8 at 4:45
m.kawasaki
1
1
It would be helpful to specify the mongoDB version. Also check if you are using keepAlive on the connection. What is your connection pool setting?
– Akrion
Nov 8 at 5:00
Thanks for the advice. The version of MongoDB is "MongoDB 3.0.12". The application connected to MongoDB is built with .net c # and is running on Windows Server 2012 R2. TCP Keepalive remains the default setting. Also when connecting from application socketOptions.keepAlive has not changed. The connectionString of the application also does not set the option as follows. <add name="config" connectionString="mongodb://user:pass@mongos1:27017,mongos2:27017,mongos3:27017/config"/>
– m.kawasaki
Nov 8 at 5:25
What is the default setting forkeepAlive
on that mongoDB version? Can you try to disable it? I assume your connection pool is 5 if using the node mongoDB driver etc.
– Akrion
Nov 8 at 5:30
I examined KeepAlive, but it was not found in ConnectionString's Option, nor was it found on the source code of MongoDB.Driver.dll (version 1.10.0.62). How do I know if you are using KeepAlive or not?
– m.kawasaki
Nov 9 at 2:11
From the connection source application, I am connecting to MongoDB with the C # .NET driver (MongoDB.Driver.dll (version 1.10.0.62)).
– m.kawasaki
Nov 9 at 2:42
add a comment |
It would be helpful to specify the mongoDB version. Also check if you are using keepAlive on the connection. What is your connection pool setting?
– Akrion
Nov 8 at 5:00
Thanks for the advice. The version of MongoDB is "MongoDB 3.0.12". The application connected to MongoDB is built with .net c # and is running on Windows Server 2012 R2. TCP Keepalive remains the default setting. Also when connecting from application socketOptions.keepAlive has not changed. The connectionString of the application also does not set the option as follows. <add name="config" connectionString="mongodb://user:pass@mongos1:27017,mongos2:27017,mongos3:27017/config"/>
– m.kawasaki
Nov 8 at 5:25
What is the default setting forkeepAlive
on that mongoDB version? Can you try to disable it? I assume your connection pool is 5 if using the node mongoDB driver etc.
– Akrion
Nov 8 at 5:30
I examined KeepAlive, but it was not found in ConnectionString's Option, nor was it found on the source code of MongoDB.Driver.dll (version 1.10.0.62). How do I know if you are using KeepAlive or not?
– m.kawasaki
Nov 9 at 2:11
From the connection source application, I am connecting to MongoDB with the C # .NET driver (MongoDB.Driver.dll (version 1.10.0.62)).
– m.kawasaki
Nov 9 at 2:42
It would be helpful to specify the mongoDB version. Also check if you are using keepAlive on the connection. What is your connection pool setting?
– Akrion
Nov 8 at 5:00
It would be helpful to specify the mongoDB version. Also check if you are using keepAlive on the connection. What is your connection pool setting?
– Akrion
Nov 8 at 5:00
Thanks for the advice. The version of MongoDB is "MongoDB 3.0.12". The application connected to MongoDB is built with .net c # and is running on Windows Server 2012 R2. TCP Keepalive remains the default setting. Also when connecting from application socketOptions.keepAlive has not changed. The connectionString of the application also does not set the option as follows. <add name="config" connectionString="mongodb://user:pass@mongos1:27017,mongos2:27017,mongos3:27017/config"/>
– m.kawasaki
Nov 8 at 5:25
Thanks for the advice. The version of MongoDB is "MongoDB 3.0.12". The application connected to MongoDB is built with .net c # and is running on Windows Server 2012 R2. TCP Keepalive remains the default setting. Also when connecting from application socketOptions.keepAlive has not changed. The connectionString of the application also does not set the option as follows. <add name="config" connectionString="mongodb://user:pass@mongos1:27017,mongos2:27017,mongos3:27017/config"/>
– m.kawasaki
Nov 8 at 5:25
What is the default setting for
keepAlive
on that mongoDB version? Can you try to disable it? I assume your connection pool is 5 if using the node mongoDB driver etc.– Akrion
Nov 8 at 5:30
What is the default setting for
keepAlive
on that mongoDB version? Can you try to disable it? I assume your connection pool is 5 if using the node mongoDB driver etc.– Akrion
Nov 8 at 5:30
I examined KeepAlive, but it was not found in ConnectionString's Option, nor was it found on the source code of MongoDB.Driver.dll (version 1.10.0.62). How do I know if you are using KeepAlive or not?
– m.kawasaki
Nov 9 at 2:11
I examined KeepAlive, but it was not found in ConnectionString's Option, nor was it found on the source code of MongoDB.Driver.dll (version 1.10.0.62). How do I know if you are using KeepAlive or not?
– m.kawasaki
Nov 9 at 2:11
From the connection source application, I am connecting to MongoDB with the C # .NET driver (MongoDB.Driver.dll (version 1.10.0.62)).
– m.kawasaki
Nov 9 at 2:42
From the connection source application, I am connecting to MongoDB with the C # .NET driver (MongoDB.Driver.dll (version 1.10.0.62)).
– m.kawasaki
Nov 9 at 2:42
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53201684%2fmongodb-the-connection-is-not-disconnected-for-a-long-time%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It would be helpful to specify the mongoDB version. Also check if you are using keepAlive on the connection. What is your connection pool setting?
– Akrion
Nov 8 at 5:00
Thanks for the advice. The version of MongoDB is "MongoDB 3.0.12". The application connected to MongoDB is built with .net c # and is running on Windows Server 2012 R2. TCP Keepalive remains the default setting. Also when connecting from application socketOptions.keepAlive has not changed. The connectionString of the application also does not set the option as follows. <add name="config" connectionString="mongodb://user:pass@mongos1:27017,mongos2:27017,mongos3:27017/config"/>
– m.kawasaki
Nov 8 at 5:25
What is the default setting for
keepAlive
on that mongoDB version? Can you try to disable it? I assume your connection pool is 5 if using the node mongoDB driver etc.– Akrion
Nov 8 at 5:30
I examined KeepAlive, but it was not found in ConnectionString's Option, nor was it found on the source code of MongoDB.Driver.dll (version 1.10.0.62). How do I know if you are using KeepAlive or not?
– m.kawasaki
Nov 9 at 2:11
From the connection source application, I am connecting to MongoDB with the C # .NET driver (MongoDB.Driver.dll (version 1.10.0.62)).
– m.kawasaki
Nov 9 at 2:42