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 SocketException using C# driver on azure
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Keivan Beigi  
View profile  
 More options Jul 23 2012, 2:10 pm
From: Keivan Beigi <kay....@gmail.com>
Date: Mon, 23 Jul 2012 11:10:52 -0700 (PDT)
Local: Mon, Jul 23 2012 2:10 pm
Subject: Re: [mongodb-user] Re: SocketException using C# driver on azure

I think I've found the solution,

MongoDefaults.MaxConnectionIdleTime = TimeSpan.FromMinutes(1);

I think the issue is the driver trying to use connections that have been
killed by azure for being idle. setting the idle time to 1 minutes fixes
it, I'll try some other values to see how high i could take it without
getting the socket exceptions.

On Sunday, July 22, 2012 8:45:10 AM UTC-7, Keivan Beigi wrote:

> I tried updating the ttl on the db and app server machines, with non luck.

> I also tried updating the driver's default values to these but still no
> help,

>  MongoDefaults.MaxConnectionIdleTime = TimeSpan.FromHours(1);
>  MongoDefaults.MaxConnectionLifeTime = TimeSpan.FromDays(1);
>  MongoDefaults.SocketTimeout = TimeSpan.FromSeconds(30);

> On Thursday, July 19, 2012 8:44:06 PM UTC-7, Keivan Beigi wrote:

>> Should I use
>> http://msdn.microsoft.com/en-us/library/system.net.servicepointmanage...
>> or http://technet.microsoft.com/en-us/library/cc957548.aspx?

>> On Thu, Jul 19, 2012 at 8:37 PM, sridhar <srid...@10gen.com> wrote:
>> > Have you looked into this

>> http://blogs.msdn.com/b/avkashchauhan/archive/2011/11/12/windows-azur....

>> > According to this post, it should already be fixed. One way to test if
>> this
>> > is your issue is to change the tcp keep alive and set it to something
>> like
>> > 30 seconds. More information on setting the tcp keep alive can be found
>> at
>> > http://technet.microsoft.com/en-us/library/cc957548.aspx. Note since
>> the
>> > keep alive is in milliseconds set it to 300,000. Do let us know if this
>> > helps.

>> > On Thursday, July 19, 2012 7:53:43 PM UTC-7, Keivan Beigi wrote:

>> >> It doesn't seem to be a specific call, it just fails randomly on
>> different
>> >> calls. it seems to be an intermittent connection issue.

>> >> On Thursday, July 19, 2012 4:55:51 PM UTC-7, craiggwilson wrote:

>> >>> I see that you are in a cursor.  How many documents are you pulling
>> back
>> >>> at a time and how long does it take to iterate through them?

>> >>> On Thursday, July 19, 2012 5:23:20 PM UTC-5, Keivan Beigi wrote:

>> >>>> We have a mongo replica set hosted on azure. every once in a while
>> the
>> >>>> connection to db fails and we get this error message.

>> >>>> is there a way to track this down and figure out what could be
>> causing
>> >>>> it? the error doesn't really say much beside the fact that
>> connection
>> >>>> failed.

>> >>>> System.IO.IOException: Unable to read data from the transport
>> >>>> connection: A connection attempt failed because the connected party
>> did not
>> >>>> properly respond after a period of time, or established connection
>> failed
>> >>>> because connected host has failed to respond. --->
>> >>>> System.Net.Sockets.SocketException: A connection attempt failed
>> because the
>> >>>> connected party did not properly respond after a period of time, or
>> >>>> established connection failed because connected host has failed to
>> respond
>> >>>>    at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset,
>> >>>> Int32 size, SocketFlags socketFlags)
>> >>>>    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32
>> offset,
>> >>>> Int32 size)
>> >>>>    --- End of inner exception stack trace ---
>> >>>>    at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32
>> offset,
>> >>>> Int32 size)
>> >>>>    at MongoDB.Bson.IO.BsonBuffer.LoadFrom(Stream stream, Int32
>> count)
>> >>>>    at MongoDB.Bson.IO.BsonBuffer.LoadFrom(Stream stream)
>> >>>>    at

>> MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinar yReaderSettings

>> >>>> readerSettings, IBsonSerializationOptions serializationOptions)
>> >>>>    at
>> MongoDB.Driver.MongoCursorEnumerator`1.GetReply(MongoConnection
>> >>>> connection, MongoRequestMessage message)
>> >>>>    at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()
>> >>>>    at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()

>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "mongodb-user" group.
>> > To post to this group, send email to mongodb-user@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > mongodb-user+unsubscribe@googlegroups.com
>> > See also the IRC channel -- freenode.net#mongodb


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.