Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion can't create new thread, closing connections

Received: by 10.236.200.194 with SMTP id z42mr8433873yhn.13.1348936597573;
        Sat, 29 Sep 2012 09:36:37 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.101.62.19 with SMTP id p19ls1296821ank.8.gmail; Sat, 29 Sep
 2012 09:36:25 -0700 (PDT)
Received: by 10.236.173.202 with SMTP id v50mr1870660yhl.19.1348936585129;
        Sat, 29 Sep 2012 09:36:25 -0700 (PDT)
Date: Sat, 29 Sep 2012 09:36:24 -0700 (PDT)
From: =?UTF-8?B?5byg6ICA5pif?= <yaoxing.zh...@gmail.com>
To: mongodb-user@googlegroups.com
Message-Id: <ea809975-3464-4886-98da-8f57ac2e5a60@googlegroups.com>
In-Reply-To: <CAJCJWG11Mt4R8vaX7ErMBUVbZ0px+3Qv=rGzhFZS4Dmbqq_0nw@mail.gmail.com>
References: <28f8abb4-5dee-48c6-a055-d0454f4e95be@googlegroups.com>
 <CAJCJWG11Mt4R8vaX7ErMBUVbZ0px+3Qv=rGzhFZS4Dmbqq_0nw@mail.gmail.com>
Subject: Re: [mongodb-user] can't create new thread, closing connections
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2446_19722017.1348936584575"

------=_Part_2446_19722017.1348936584575
Content-Type: multipart/alternative; 
	boundary="----=_Part_2447_17273970.1348936584575"

------=_Part_2447_17273970.1348936584575
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Thanks for the tip. We did consider using a new driver, but it seems there=
=20
are too many incompatible changes done. Still need some time to review our=
=20
code before we can use it.
Is there any other work around? I really need to use the slave instance to=
=20
reduce master presure in a short time.

=E5=9C=A8 2012=E5=B9=B49=E6=9C=8829=E6=97=A5=E6=98=9F=E6=9C=9F=E5=85=ADUTC+=
8=E4=B8=8A=E5=8D=8811=E6=97=B615=E5=88=8639=E7=A7=92=EF=BC=8CRobert Stam=E5=
=86=99=E9=81=93=EF=BC=9A
>
> Version 1.1 of the C# driver is very old. You may be encountering this=20
> issue:
>
> https://jira.mongodb.org/browse/CSHARP-302
>
> Can you try a newer version of the driver?
>
> On Fri, Sep 28, 2012 at 2:39 PM, =E5=BC=A0=E8=80=80=E6=98=9F <yaoxin...@g=
mail.com <javascript:>>wrote:
>
>> hello everyone,
>> while using a master/slave cluster to serving my web application, I get=
=20
>> the error "can't create thread. closing connection". I dug a lot but did=
n't=20
>> find any solution. anyone who ran into the same issue could you please s=
hed=20
>> me some light?
>> here's the detail of my issue:
>> I'm using C# driver v1.1.0.4184 to connect to a slave instance which is=
=20
>> running mongodb 2.0.7 (the master instance runs 2.0.2), with option=20
>> maxPoolSize=3D300;slaveOk=3Dtrue.
>> when the web server is online, I can see from the log that the connectio=
n=20
>> qty increases very rapidly. and when it reaches max user process limit=
=20
>> (ulimit -u =3D 1024), I begin to see the error:
>> Fri Sep 28 06:37:21 [initandlisten] connection accepted from=20
>> xx.xx.xx.xx:64034 #1073 (1014 connections now open)
>> Fri Sep 28 06:37:21 [initandlisten] pthread_create failed: errno:11=20
>> Resource temporarily unavailable
>> Fri Sep 28 06:37:21 [initandlisten] can't create new thread, closing=20
>> connection
>> after some internet searching, I decided to increase "ulimit -u" to=20
>> 20480. I do noticed another message from the log. I can't find the exact=
=20
>> log now, but it says something like mongodb is releasing unused=20
>> connections. when I see this message, the connection qty decreases very=
=20
>> quickly. however, new connections are created even more quickly. so afte=
r a=20
>> longer period, I end up got the same error again.
>> then I tried to stop master/slave replication, and make both servers=20
>> master. this time everything works fine, connection qty is always kept l=
ess=20
>> than 250.
>> here's what I think:
>> assuming from the log, I think it's the C# driver who didn't know it has=
=20
>> created enough connections in the connection pool, instead, it kept=20
>> creating new ones. thus the old ones are never used again, after a perio=
d,=20
>> mongodb thinks the old connections are not used anymore and released the=
m.=20
>> that's why I see the 2nd message.
>> what I didn't figure out is why does this issue only happen to slave=20
>> instance? does C# driver use monogdb to store it's current connection po=
ol=20
>> size? because this way it can never write the qty to slave instance, and=
 I=20
>> guess that's why it kept creating new connections because it can't get h=
ow=20
>> many connections are already created.
>>
>> thank you for reading my long post. really hope someone can't help me=20
>> figure out a solution.
>>
>> --=20
>> You received this message because you are subscribed to the Google
>> Groups "mongodb-user" group.
>> To post to this group, send email to mongod...@googlegroups.com<javascri=
pt:>
>> To unsubscribe from this group, send email to
>> mongodb-user...@googlegroups.com <javascript:>
>> See also the IRC channel -- freenode.net#mongodb
>>
>
>
------=_Part_2447_17273970.1348936584575
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Thanks for the tip. We did consider using a new driver, but it seems there =
are too many incompatible changes done. Still need some time to review our =
code before we can use it.<div>Is there any other work around? I really nee=
d to use the slave instance to reduce master presure in a short time.<br><d=
iv><br>=E5=9C=A8 2012=E5=B9=B49=E6=9C=8829=E6=97=A5=E6=98=9F=E6=9C=9F=E5=85=
=ADUTC+8=E4=B8=8A=E5=8D=8811=E6=97=B615=E5=88=8639=E7=A7=92=EF=BC=8CRobert =
Stam=E5=86=99=E9=81=93=EF=BC=9A<blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
>Version 1.1 of the C# driver is very old. You may be encountering this iss=
ue:<div><br></div><div><a href=3D"https://jira.mongodb.org/browse/CSHARP-30=
2" target=3D"_blank">https://jira.mongodb.org/<wbr>browse/CSHARP-302</a></d=
iv><div><br></div><div>
Can you try a newer version of the driver?<br><br><div class=3D"gmail_quote=
">On Fri, Sep 28, 2012 at 2:39 PM, =E5=BC=A0=E8=80=80=E6=98=9F <span dir=3D=
"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=
=3D"vEd9HDbMFBQJ">yaoxin...@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>hello everyone,</div><div>while using a=
 master/slave cluster to serving my web application, I get the error "can't=
 create thread. closing connection". I dug a lot but didn't find any soluti=
on. anyone who ran into the same issue could you please shed me some light?=
</div>
<div>here's the detail of my issue:</div><div>I'm using C# driver v1.1.0.41=
84 to connect to a slave instance which is running mongodb 2.0.7 (the maste=
r instance runs 2.0.2), with option maxPoolSize=3D300;slaveOk=3Dtrue.</div>
<div>when the web server is online, I can see from the log that the connect=
ion qty increases very rapidly. and when it reaches max user process limit =
(ulimit -u =3D 1024), I begin to see the error:</div><div>Fri Sep 28 06:37:=
21 [initandlisten] connection accepted from xx.xx.xx.xx:64034 #1073 (1014 c=
onnections now open)</div>
<div>Fri Sep 28 06:37:21 [initandlisten] pthread_create failed: errno:11 Re=
source temporarily unavailable</div><div>Fri Sep 28 06:37:21 [initandlisten=
] can't create new thread, closing connection</div><div>after some internet=
 searching, I decided to increase "ulimit -u" to 20480. I do noticed anothe=
r message from the log. I can't find the exact log now, but it says somethi=
ng like mongodb is releasing unused connections. when I see this message, t=
he connection qty decreases very quickly. however, new connections are crea=
ted even more quickly. so after a longer period, I end up got the same erro=
r again.</div>
<div>then I tried to stop master/slave replication, and make both servers m=
aster. this time everything works fine, connection qty is always kept less =
than 250.</div><div>here's what I think:</div><div>assuming from the log, I=
 think it's the C# driver who didn't know it has created enough connections=
 in the connection pool, instead, it kept creating new ones. thus the old o=
nes are never used again, after a period, mongodb thinks the old connection=
s are not used anymore and released them. that's why I see the 2nd message.=
</div>
<div>what I didn't figure out is why does this issue only happen to slave i=
nstance? does C# driver use monogdb to store it's current connection pool s=
ize? because this way it can never write the qty to slave instance, and I g=
uess that's why it kept creating new connections because it can't get how m=
any connections are already created.</div>
<div><br></div><div>thank you for reading my long post. really hope someone=
 can't help me figure out a solution.</div><span><font color=3D"#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google<br>
Groups "mongodb-user" group.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"vEd9HDbMFBQJ">mongod...@googlegroups.com</a><b=
r>
To unsubscribe from this group, send email to<br>
<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"vEd9HDbM=
FBQJ">mongodb-user...@<wbr>googlegroups.com</a><br>
See also the IRC channel -- <a href=3D"http://freenode.net#mongodb" target=
=3D"_blank">freenode.net#mongodb</a><br>
</font></span></blockquote></div><br></div>
</blockquote></div></div>
------=_Part_2447_17273970.1348936584575--

------=_Part_2446_19722017.1348936584575--