MaxConnections

M

MattC

I've written an HTTPHandler that implements IHttpAsyncHandler. This handler
makes a call to a webservice that will send back a byte[] to be sent back to
the webrowser as an image.

I've set the maxconnections setting on the web.config for the handler and
the webservice to:

<system.net>
<connectionManagement>
<add address="*" maxconnection="20"/>
</connectionManagement>
</system.net>

But when debugging I can see that it is still only making 2 requests at a
time. How can I make a handler that will allow for more than 2 requests at
a time.

TIA
 
A

Aidy

Someone correct me if I'm wrong, but there is a limit at the TCP/IP layer
that means you can only have two TCP/IP connections to the same machine on
the same port at a time. Point IE at a graphic-heavy site and you'll see it
downloads images 2 at a time. As this limit is at the TCP/IP layer you
can't control it from IIS or ASP.
 
J

Juan T. Llibre

Windows Server 2003 SP1 removed the need to set a higher limit for maxconnections.

The number of simultaneous connections in W2K3 SP1 is now limited
only by available system resources or the MaxConnections registry entry.

You *can* set a higher number of connections in an unpatched Windows Server 2003:

Registry path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters

Registry entry
MaxConnections

Value Type
DWORD

Valid data value ranges for this entry are 0 to 4294967295.

Matt, you seem to have a typo :

<add address="*" maxconnection="20"/>

That should be :
<add address="*" maxconnections="20"/>

In any case, if you're running an unpatched W2K3, try setting the registry entry, per the above.







Aidy said:
Someone correct me if I'm wrong, but there is a limit at the TCP/IP layer that means you can only
have two TCP/IP connections to the same machine on the same port at a time. Point IE at a
graphic-heavy site and you'll see it downloads images 2 at a time. As this limit is at the TCP/IP
layer you can't control it from IIS or ASP.

MattC said:
I've written an HTTPHandler that implements IHttpAsyncHandler. This handler makes a call to a
webservice that will send back a byte[] to be sent back to the webrowser as an image.

I've set the maxconnections setting on the web.config for the handler and the webservice to:

<system.net>
<connectionManagement>
<add address="*" maxconnection="20"/>
</connectionManagement>
</system.net>
But when debugging I can see that it is still only making 2 requests at a time. How can I make a
handler that will allow for more than 2 requests at a time.

TIA
 
M

MattC

Juan,

Thanks but the limit is impossed by the web browsers request queue in this
case. So IE only ever makes 2 concurrent requests and will block until each
requests returns before sending the next.

I did find that altering:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\MaxConnectionsPerServer

and setting to 20 odd really helps, but that isn't somethign I can tell
users to do :s

Also I'm using .NET2.0 so the system.net entry is maxconnection, it
complains of unknown attribute with maxconnectionS.

regards

Matt
Juan T. Llibre said:
Windows Server 2003 SP1 removed the need to set a higher limit for
maxconnections.

The number of simultaneous connections in W2K3 SP1 is now limited
only by available system resources or the MaxConnections registry entry.

You *can* set a higher number of connections in an unpatched Windows
Server 2003:

Registry path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters

Registry entry
MaxConnections

Value Type
DWORD

Valid data value ranges for this entry are 0 to 4294967295.

Matt, you seem to have a typo :

<add address="*" maxconnection="20"/>

That should be :
<add address="*" maxconnections="20"/>

In any case, if you're running an unpatched W2K3, try setting the registry
entry, per the above.







Aidy said:
Someone correct me if I'm wrong, but there is a limit at the TCP/IP layer
that means you can only
have two TCP/IP connections to the same machine on the same port at a
time. Point IE at a
graphic-heavy site and you'll see it downloads images 2 at a time. As
this limit is at the TCP/IP
layer you can't control it from IIS or ASP.

MattC said:
I've written an HTTPHandler that implements IHttpAsyncHandler. This
handler makes a call to a
webservice that will send back a byte[] to be sent back to the webrowser
as an image.

I've set the maxconnections setting on the web.config for the handler
and the webservice to:

<system.net>
<connectionManagement>
<add address="*" maxconnection="20"/>
</connectionManagement>
</system.net>
But when debugging I can see that it is still only making 2 requests at
a time. How can I make a
handler that will allow for more than 2 requests at a time.

TIA
 
C

Cowboy \(Gregory A. Beamer\)

If I am undestanding correctly, you are talking about client connections,
and not server connections?

If so, this is an IE thing and can be altered only through the registry with
the Internet Settings\MaxConnectionsPerServer key.

I see Juan has jumped in as well. If it is server side, and you are using
Windows Server 2003, I would go there first.
 

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,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top