473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HttpWebRequest and maximum http connection

In a windows form I execute a lot of HttpWebRequest. Each request run
in his own thread and every requests have the same target server.
Looking at netstat and in the web server logs it seems to me that only
2 connection are opened even if I have 100 threads.
Do you know how can I modify this limit in my application?
Thanks.

Nov 14 '06 #1
7 10345
Hi,

faser wrote:
In a windows form I execute a lot of HttpWebRequest. Each request run
in his own thread and every requests have the same target server.
Looking at netstat and in the web server logs it seems to me that only
2 connection are opened even if I have 100 threads.
Do you know how can I modify this limit in my application?
Thanks.
The two-connections limits is set by HTTP according to RFC2616. On
Windows clients, you can increase this limit using the following
registry settings:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Internet
Settings
or to (all users):
HKEY_USERS\.Default\Software\Microsoft\Windows\Cur rentVersion\Internet
Settings
if you are the main or only user on this computer.

In the right hand pane you need to create these 2 DWORD [REG_DWORD]
Values because they are not present by default [don't type the quotes
though :)]:

· "MaxConnectionsPer1_0Server": defines the number of
simultaneous requests to a single HTTP 1.0 server. Double-click on it
and type any integer value between 8 and 32 (I use 16) in the Decimal
box. Default is 4.

· "MaxConnectionsPerServer": defines the number of simultaneous
requests to a single HTTP 1.1 server. Double-click on it and type any
integer value between 4 and 24 (I use 8) in the Decimal box. Default is 2.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 14 '06 #2

Laurent Bugnion wrote:
The two-connections limits is set by HTTP according to RFC2616. On
Windows clients, you can increase this limit using the following
registry settings:
Ok, now I understand. Thank you.

Nov 14 '06 #3
Thus wrote Laurent,
Hi,

faser wrote:
>In a windows form I execute a lot of HttpWebRequest. Each request
run
in his own thread and every requests have the same target server.
Looking at netstat and in the web server logs it seems to me that
only
2 connection are opened even if I have 100 threads.
Do you know how can I modify this limit in my application?
Thanks.
The two-connections limits is set by HTTP according to RFC2616. On
Windows clients, you can increase this limit using the following
registry settings:
[...]

You don't have to hack the registry to use more parallel connections: See
ServicePointManager.DefaultPersistentConnectionLim it and ServicePointManager.DefaultConnectionLimit.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Nov 15 '06 #4
Hi Joerg,

Joerg Jooss wrote:
Thus wrote Laurent,
*music playing in the background......*
You don't have to hack the registry to use more parallel connections:
See ServicePointManager.DefaultPersistentConnectionLim it and
ServicePointManager.DefaultConnectionLimit.

Cheers,
I was not aware of that, having spent most of my .NET time doing ASP.NET
applications, where JavaScript doesn't this kind of ability...

Question: Do you happen to know if that's also possible from within a
XBAP application running in Internet zone? I guess I'll have to test that.

Greetings and thanks,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 15 '06 #5
Thus wrote Laurent,
Hi Joerg,

Joerg Jooss wrote:
>Thus wrote Laurent,
*music playing in the background......*
>You don't have to hack the registry to use more parallel connections:
See ServicePointManager.DefaultPersistentConnectionLim it and
ServicePointManager.DefaultConnectionLimit.

Cheers,
I was not aware of that, having spent most of my .NET time doing
ASP.NET applications, where JavaScript doesn't this kind of ability...

Question: Do you happen to know if that's also possible from within a
XBAP application running in Internet zone? I guess I'll have to test
that.
Looking at my CAS configuration the answer is yes, but you should test it
anyway ;-)

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Nov 15 '06 #6
Hi Joerg,

Joerg Jooss wrote:
Thus wrote Laurent,
>Question: Do you happen to know if that's also possible from within a
XBAP application running in Internet zone? I guess I'll have to test
that.

Looking at my CAS configuration the answer is yes, but you should test
it anyway ;-)

Cheers,
Unfortunately, looking at the documentation, I think the answer is no...
but once again, I really need to test it. I'll do ASAP and report.

..NET Framework Security:
WebPermission for unrestricted web permissions. Associated Enumeration:
Unrestricted

Greetings,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Nov 16 '06 #7
Thus wrote Laurent,
Hi Joerg,

Joerg Jooss wrote:
>Thus wrote Laurent,
>>Question: Do you happen to know if that's also possible from within
a XBAP application running in Internet zone? I guess I'll have to
test that.
Looking at my CAS configuration the answer is yes, but you should
test it anyway ;-)

Cheers,
Unfortunately, looking at the documentation, I think the answer is
no... but once again, I really need to test it. I'll do ASAP and
report.
Karsten Januszewski is working on a pretty extensive blog entry that covers
web services and XBAPs. Keep an eye on http://blogs.msdn.com/karstenj/.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Nov 16 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris | last post by:
Hi, I need some help here. Is it possible to close an HTTP connection in the middle of a php script? For example: <html>
0
by: Rob Levine | last post by:
(This post also available at http://roblevine.blogspot.com/2004/11/frustrating-http-connection-behaviour.html in a slightly more readable format!) Hi All, I seem to be having a bit of a...
2
by: Shachar | last post by:
Hi All, I have a .Net (2.0 beta 2) smart client running on windows XP, connected to a .Net (2.0 beta 2) web service running on windows 2003. When I don't asking for request from the server...
1
by: Tejpal | last post by:
Hi Guys, I have made a web service to accept applicant information and then generate account number in the web method and gives back Account number to applicant. I want to control the traffic...
1
by: Simon | last post by:
Is there HTTP connection limit of 2 simultaneous connections in webservices? For example what hapens if you use webservices form ASP.NET web application? Presumably ASP.NET is webservices client to...
3
by: Charles | last post by:
Hello, I'm think about using mod_python for a project but I need to make sure: Does mod_python time out after a minute ? (I hope not). If I leave an HTTP connection open so that the content keeps...
5
by: yinglcs | last post by:
Hi, I am new to python. I read an example here about how to fetch data thru a HTTP connection: http://diveintopython.org/http_web_services/review.html, My question is how can i save the data...
2
by: jason.m.ho | last post by:
Hello! I am trying to build an ajax chat system. Currently I have it so that when you chat, you upload your message to the database, and each client is polling that database to see if he/she has...
5
by: campos | last post by:
Hi, I am trying to use Ajax to connect with an HTTP server and do some interactions. The first HTTP request will be longer than others due to the 3-way hand shake. So I'd like to reuse that TCP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.