Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Too many pending secure conversations

1,408 views
Skip to first unread message

Kasper G. Christensen

unread,
Mar 26, 2009, 5:05:30 AM3/26/09
to
When my wcf-service with message-level security is called by a number of
users, sometimes the client get the exception:

System.ServiceModel.ServerTooBusyException
Server 'http://xxx/yyy.svc' sent back a fault indicating it is too busy
to process the request. Please retry later. Please see the inner
exception for fault details.

--- inner exception ---
System.ServiceModel.FaultException
There are too many pending secure conversations on the server. Please
retry later.


Where do I specify how many pending secure conversations is allowed, and
is there a perfomance counter or some other way to identify how many
conversations is actually pending?

The server doesn't seem to be overloaded, so if I could just get the
service to accept more conversations it would be fine. I have fiddled
with ServiceThrottling to no avail.

TIA

Kasper

Arnold@arnold.com Mr. Arnold

unread,
Mar 26, 2009, 7:32:57 PM3/26/09
to

"Kasper G. Christensen" <kas...@removethisplease.mamut.dk> wrote in message
news:uMcdEIfr...@TK2MSFTNGP05.phx.gbl...

WFC on the server side has a default setting on 10 concurrent connects. It's
a setting in the Web.config that can be changed to increase the number.
That's what I was told by someone who was working on a WCF solution when
those 10 concurrent connections were reached.

Kasper G. Christensen

unread,
Mar 27, 2009, 3:19:38 AM3/27/09
to
> WFC on the server side has a default setting on 10 concurrent connects.
> It's a setting in the Web.config that can be changed to increase the
> number. That's what I was told by someone who was working on a WCF
> solution when those 10 concurrent connections were reached.
>

Thank you for your reply. I think what you are refering to, is
ServiceThrottling, set under serviceBehaviours, where I have already
increased the number of concurrent connections like this:

<serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000"
maxConcurrentInstances="1000" />

The "Instances" performance counter tells me (since I have
InstancePerConnection mode set), that there is around 50 concurrent
connections to the server, when the problem arises (and at other times,
where there is no problem).

There must be something else limiting the numer of pending secure
conversations.

If it is of any help, here are the relevant sections from my .config file:

<service behaviorConfiguration="eDocServiceBehaviour"
name="Mamut.eDocServer.Service.eDocService">
<endpoint address="http://xxx/yyy.svc"
binding="wsHttpBinding" bindingConfiguration="MessageAndUserName"
name="SecuredByUsername"
contract="Mamut.eDocServer.Service.IeDocServiceContract" />
<host>
<baseAddresses>
<add baseAddress="http://xxx/yyy.svc" />
</baseAddresses>
<timeouts closeTimeout="00:00:30" />
</host>
</service>


<behavior name="eDocServiceBehaviour">
<serviceCredentials>
<serviceCertificate findValue="02" storeLocation="LocalMachine"
storeName="My" x509FindType="FindBySerialNumber" />
<userNameAuthentication
userNamePasswordValidationMode="MembershipProvider"
membershipProviderName="eDocCustomerProvider" />
</serviceCredentials>
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="false" />
<serviceThrottling maxConcurrentCalls="1000"
maxConcurrentSessions="1000"
maxConcurrentInstances="1000" />
</behavior>


<wsHttpBinding>
<binding name="MessageAndUserName" receiveTimeout="00:01:00"
maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" />
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
<binding name="WSHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false"
transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="Certificate"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="None"
negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>


Best regards

Kasper

Arnold@arnold.com Mr. Arnold

unread,
Mar 27, 2009, 5:09:29 PM3/27/09
to

"Kasper G. Christensen" <kas...@removethisplease.mamut.dk> wrote in message
news:ei55kxqr...@TK2MSFTNGP04.phx.gbl...

>> WFC on the server side has a default setting on 10 concurrent connects.
>> It's a setting in the Web.config that can be changed to increase the
>> number. That's what I was told by someone who was working on a WCF
>> solution when those 10 concurrent connections were reached.
>>
>
> Thank you for your reply. I think what you are refering to, is
> ServiceThrottling, set under serviceBehaviours, where I have already
> increased the number of concurrent connections like this:
>
> <serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000"
> maxConcurrentInstances="1000" />
>
> The "Instances" performance counter tells me (since I have
> InstancePerConnection mode set), that there is around 50 concurrent
> connections to the server, when the problem arises (and at other times,
> where there is no problem).
>
> There must be something else limiting the numer of pending secure
> conversations.

You should take a look at this.

http://msdn.microsoft.com/en-us/library/ms733795.aspx


Kasper G. Christensen

unread,
Mar 30, 2009, 6:09:34 AM3/30/09
to
>> There must be something else limiting the numer of pending secure
>> conversations.
>
> You should take a look at this.
>
> http://msdn.microsoft.com/en-us/library/ms733795.aspx

Thank you!

Unfortunately this link is about reliable sessions whereas my problem
apparently has to do with the "secure" part of the stack. I haven't a
explicit reliable binding element, and therefore can't change the
MaxPendingChannels property.

I found this:
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/745b95d2-1480-4618-89f5-1339d6ee228d/#page:1
where there is code for getting the ReliableSessionBindingElement:

BindingElementCollection elements = ep.Binding.CreateBindingElements();
ReliableSessionBindingElement reliableSessionElement =
elements.Find<ReliableSessionBindingElement>();

I tried this, but reliableSessionElement is null. In other words I have
no ReliableSessionBindingElement for which to set the MaxPendingChannels
property. I can't seem to find anything similar for secure conversation?

Thank you for your help so far.

Best regards

Kasper

Kasper G. Christensen

unread,
Jun 3, 2009, 2:32:06 AM6/3/09
to
I have received an answer from another developer, who has run into this
problem. He writes:

The problem is not the WCF Service, but rather the wsHttpBinding. The
default number of secure connections allowed is 128 on a 2 minute
timeout, which ironically cannot be changed unless you use a
customBinding rather then a wsHttpBinding. In order to intialize a
custom binding with the same setting as a wsHttpBinding you have to
create it programmatically rather then through the Web.Config (you can
dump the complete wsHttpBinding to a file, but that�s an ugly solution
as any updates made to it would require manual labor and followup)

I think it very probable that this is the problem, so when I get around
to it, I will try to convert my binding to a custom binding
(http://blog.salamandersoft.co.uk/CommentView,guid,0b691f56-47eb-4715-8ffd-134250a70817.aspx
seems to be helpful doing this) and increase maxPendingSessions

I will try to remember to return here with the result. Hoping that this
helps someone else in the future.

Best regards

Kasper

Kasper G. Christensen skrev:

0 new messages