MaxConnections

Discussion in 'ASP .Net' started by MattC, May 14, 2007.

  1. MattC

    MattC Guest

    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
    MattC, May 14, 2007
    #1
    1. Advertising

  2. MattC

    Aidy Guest

    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" <> wrote in message
    news:...
    > 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
    >
    >
    >
    >
    >
    >
    Aidy, May 14, 2007
    #2
    1. Advertising

  3. 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.






    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Aidy" <> wrote in message news:...
    > 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" <> wrote in message news:...
    >> 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
    Juan T. Llibre, May 14, 2007
    #3
  4. MattC

    MattC Guest

    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" <> wrote in message
    news:...
    > 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.
    >
    >
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > "Aidy" <> wrote in message
    > news:...
    >> 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" <> wrote in message
    >> news:...
    >>> 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

    >
    >
    MattC, May 14, 2007
    #4
  5. 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.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com

    *********************************************
    Think outside the box!
    *********************************************
    "MattC" <> wrote in message
    news:...
    > 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
    >
    >
    >
    >
    >
    >
    Cowboy \(Gregory A. Beamer\), May 14, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curtis Justus

    MaxConnections questions and issues

    Curtis Justus, Mar 21, 2007, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    111
    Curtis Justus
    Mar 21, 2007
Loading...

Share This Page