Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

.Net 2.0 : Soap client : reusing http connections ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve B. - 17 Jul 2007 08:04 GMT
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
George Ter-Saakov - 17 Jul 2007 16:18 GMT
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.

> Hi,
>
[quoted text clipped - 26 lines]
> Thanks in advance,
> Steve
Steve B. - 17 Jul 2007 17:04 GMT
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

> In your application when calling you webservice
> you should have a code like this
[quoted text clipped - 41 lines]
>> Thanks in advance,
>> Steve
bruce barker - 17 Jul 2007 16:29 GMT
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)

> Hi,
>
[quoted text clipped - 23 lines]
> Thanks in advance,
> Steve

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.