Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9236335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:16:03+00:00 2026-06-18T07:16:03+00:00

trying to get to the bottom of this! i have a very basic app

  • 0

trying to get to the bottom of this!

i have a very basic app that is using httpwebrequests to login, navigate to a page and then grab the html of that page. it then preforms another webrequest to a third page every 5 mins in a loop.

its all working fine and is single threaded (and fairly old), however circumstances have changed and i now need to run multiple instances of this app closely together (i have a .bat starting the app every 2seconds as a temporary measure until i am able to code a new multithreaded solution).

when the first instances of the app start everything is fine, first request is completed in ~2seconds. second one in about 3seconds.

however as more and more instances of this app are run concurrently (>100) something strange starts to happen.

the first web request still takes ~2 seconds, however the second request gets delayed much more >1min up to the point of timeout. i cant seem to think why this is. the second page is larger than the first, but nothing out of the ordinary that would take >1min to download.

The internet connection and hardware of this server is more than capable of handling these requests.

 CookieContainer myContainer = new CookieContainer();
        // first request is https
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(https://mysite.com/urlone);                                
        request.CookieContainer = myContainer;
        request.Proxy = proxy;
        Console.WriteLine(System.DateTime.Now.ToLongTimeString() + "  " + "Starting login request");
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        Stream resStream = response.GetResponseStream();

        string tempString = null;
        int count = 0;

        do
        {
            // fill the buffer with data
            count = resStream.Read(buf, 0, buf.Length);

            // make sure we read some data
            if (count != 0)
            {
                // translate from bytes to ASCII text
                tempString = Encoding.ASCII.GetString(buf, 0, count);

                // continue building the string
                sb.Append(tempString);
            }
        }
        while (count > 0); // any more data to read?
        sb.Clear();
       response.Close();
       resStream.Close();
       string output6;



        Console.WriteLine(System.DateTime.Now.ToLongTimeString() + "  " + "login request comeplete");
        HttpWebRequest request6 = (HttpWebRequest)WebRequest.Create(@"http://mysite.com/page2");
        request6.CookieContainer = myContainer;
        response = (HttpWebResponse)request6.GetResponse();
        resStream = response.GetResponseStream();
        tempString = null;
        count = 0;

        do
        {
            count = resStream.Read(buf, 0, buf.Length);


            if (count != 0)
            {
                tempString = Encoding.ASCII.GetString(buf, 0, count);

                sb.Append(tempString);
            }
        }

        while (count > 0);
        output6 = sb.ToString();
        sb.Clear();
        response.Close();
        resStream.Close();

Any ideas? Im not very advanced with http web requests so if someone could check i haven’t made any silly code mistakes above id appreciate it. Im at a loss as to what other information i may need to include here, if i have missed anything out please tell me and i will do my best to provide.
Thanks in advance.

EDIT 1:

I used fiddler to find out the source of the issue. It looks like the issue lies with the application (or windows) not sending the requests for some reason – the physical request actually takes < 1second according to fiddler.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:16:04+00:00Added an answer on June 18, 2026 at 7:16 am

    Check out a few things

    1. ServicePointManager.DefaultConnectionLimit : if you are planning to open more then 100 connection the set this value to something like 200-300.
    2. If possible use HttpWebRequest.KeepALive = true
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic question about loops. I'm trying to get into programming
I have a very simple gsp page that has a button. I'm trying to
I am trying to get a footer that will always stay at the bottom
I'm trying to do something very basic here, something I wouldn't have expected to
I'm trying to get my footer to stick to the bottom of my page.
For days now I have been trying to get to the bottom of what
I know this is a very common problem. I was trying to get a
I'm trying to get a table form a numpy array at the barplot bottom
I am trying get all html links within a string and replace them using
I am trying get all html links within a string and replace them using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.