[SERVER-3321] Server begin to refuse connections after 200 Created: 23/Jun/11 Updated: 29/Aug/11 Resolved: 23/Jun/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | 1.8.1 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Minor - P4 |
| Reporter: | davyzhang | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | connection | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
linux macos |
||
| Participants: |
| Description |
|
If I connect to mongodb quickly in very short time. Mongodb server will soon be un-responsable and pymongo driver will raise an exception even I tried sleep 1 sec, After about 200 connections mongo server begin to refuse connections I have a production server splited in several processes when they connect to mongodb at the same time the problem will show up reproduce the problem use the code below from pymongo.errors import OperationFailure, AutoReconnect l = [] |
| Comments |
| Comment by davyzhang [ 23/Jun/11 ] |
|
OK, my bad, its a false alert. I didn't check the real connection numbers. sorry and thanks for you advice and timing answer |
| Comment by davyzhang [ 23/Jun/11 ] |
|
if I don't sleep 1 sec it will refuse connection very quickly. say about 5 more connections |
| Comment by davyzhang [ 23/Jun/11 ] |
|
> db.serverStatus() , }, , , , }, , , , , , , |
| Comment by Scott Hernandez (Inactive) [ 23/Jun/11 ] |
|
Please post the data from that command. Mongostat numbers are not the same, or useful here. (on my osx machine it is 204 by default, since max open files per process is 256) If you want more connections on osx (and on linux) you can increase your max open files: ulimit -n will tell you the number. |
| Comment by davyzhang [ 23/Jun/11 ] |
|
actually I didn't see the serverStatus in shell, but I opened a mongostat here is the result nearly the break point insert query update delete getmore command flushes mapped vsize res locked % idx miss % qr|qw ar|aw netIn netOut conn repl time |
| Comment by Scott Hernandez (Inactive) [ 23/Jun/11 ] |
|
Please post db.serverStatus()? Generally it is best to share a Connection and not to create lots of them. Each Connection has a pool of sockets to the server. |
| Comment by davyzhang [ 23/Jun/11 ] |
|
if I ignored this exception and continue retry, it will finally made connection and done, but it took long time to finish |