-1

I am using the default value of MAXBUfferPoolSIzeand MaxBufferSize. However, I am recieving an error:

"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.".

The Max Pool size is also increased. How can I find the value that should be appropriate for MAXBUfferPoolSIze and MaxBufferSizeto avoid this error.

  • 2
    An excellent explaination of these settings can be found at http://social.msdn.microsoft.com/Forums/en/wcf/thread/d6e234d3-942f-4e9d-8470-32618d3f3212/ but I think you really need to ask yourself how many concurrent connections you expect and why they are all being used up. – Ilion Mar 14 '12 at 06:08
  • The question/problem has nothing to do with "MaxBufferPoolSize", the pool that WCF is referring to is the connection pool managed by an underlying channel factory. The properties mentioned by the OP are for buffers managed by each channel. These are two completely unrelated things. Please consider changing the title of this question, also, a mod should consider closing this question as non-constructive. – Shaun Wilson Apr 05 '13 at 17:35

1 Answers1

3

If you are seeing this it is telling you about a problem - the answer is not usually "make the pool bigger" - it is "stop leaking connections".

This almost universally means that you are not disposing a connection in one or more places. It is the call to Dispose() that makes a connection available in the pool, so whenever you are using a connection it is critical that you dispose it - otherwise you are dependent on garbage collection, which is non-deterministic. For example - make sure you have:

using(var conn = [create a connection instance])
{
    // do something with the connection
}
Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • OK. I will implement that but meanwhile will increasing the buffer size will hit the performance..I don't have performance tool how can I test that – user1268082 Mar 15 '12 at 16:09