.Net 2.0 : Soap client : reusing http connections ?

S

Steve B.

Hi,

We have built an asp.net application that uses some web services (actually
WSS web services). Because of high number of users and theirs simultaneous
requests, web services are very frequently requested.

Using standard Visual Studio web references, we cannot control the http
connections to the web services. The framework seems to keep HTTP connection
opened until the 4 minutes (by default) timeout occurs. Each time the proxy
to the web service is called, a new http connection is made.

This cause the asp.net web application to crash after some minutes. Deep
investigations show that the server reach its 5000 simultaneous connexions.

I have no control over the behavior of the server side (Sharepoint), so I
need to find to a way to reduce HttpConnections... The code has been
reviewed to reduce the number of calls to its minimum but the problem still
occurs. Is there any way to ask the framework to reuse http connections ?
Moreover, the web service is requested always with the same credentials (the
asp.net app pool identity) and we are calling only 3 asmx services (3
proxies shared along the whole request execution).

Note that we worked around the problem by activating caches (business cache,
and asp.net cache) but that cause the displayed data to be not accurracy.


Thanks in advance,
Steve
 
G

George Ter-Saakov

In your application when calling you webservice
you should have a code like this
localhost.Service service = new localhost.Service();

Do you call service.dispose()? when done with the webservice?

If not you should.

Also you might want to specify ConnectionGroupName on your service
properties.

You can read more in topic HttpWebRequest.ConnectionGroupName



George.
 
B

bruce barker

you must not be closing the response streams, so the connection is not
returned to the pool. 4 minutes is well over keep-alive timeouts
(usually a few seconds).

normally (if your code has no bugs) a busy server will keep using the
same connections for subsequent web service calls. you can set the
connection properties to always close (say you are using bigip pooling
and load balancing)


-- bruce (sqlwork.com)
 
S

Steve B.

I actually close dispose as often as I can

I'll take a deeper look at this property and if I understand correctly, i
can set this connectiongroupname to the same value for all proxy for each
targetted server...


Thanks,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top