HttpWebRequest and maximum http connection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • faser

    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.

  • Laurent Bugnion

    #2
    Re: HttpWebRequest and maximum http connection

    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_US ER\Software\Mic rosoft\Windows\ CurrentVersion\ Internet
    Settings
    or to (all users):
    HKEY_USERS\.Def ault\Software\M icrosoft\Window s\CurrentVersio n\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 :)]:

    · "MaxConnections Per1_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.

    · "MaxConnections PerServer": 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

    Comment

    • faser

      #3
      Re: HttpWebRequest and maximum http connection


      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.

      Comment

      • Joerg Jooss

        #4
        Re: HttpWebRequest and maximum http connection

        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
        ServicePointMan ager.DefaultPer sistentConnecti onLimit and ServicePointMan ager.DefaultCon nectionLimit.

        Cheers,
        --
        Joerg Jooss
        news-reply@joergjoos s.de


        Comment

        • Laurent Bugnion

          #5
          Re: HttpWebRequest and maximum http connection

          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 ServicePointMan ager.DefaultPer sistentConnecti onLimit and
          ServicePointMan ager.DefaultCon nectionLimit.
          >
          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

          Comment

          • Joerg Jooss

            #6
            Re: HttpWebRequest and maximum http connection

            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 ServicePointMan ager.DefaultPer sistentConnecti onLimit and
            >ServicePointMa nager.DefaultCo nnectionLimit.
            >>
            >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
            news-reply@joergjoos s.de


            Comment

            • Laurent Bugnion

              #7
              Re: HttpWebRequest and maximum http connection

              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

              Comment

              • Joerg Jooss

                #8
                Re: HttpWebRequest and maximum http connection

                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
                news-reply@joergjoos s.de


                Comment

                Working...