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 6009115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:55:29+00:00 2026-05-23T01:55:29+00:00

I am trying to imitate a scenario where 300,000 consumers are accessing a server.

  • 0

I am trying to imitate a scenario where 300,000 consumers are accessing a server. So I am trying to create the pseudo clients, by repeatedly querying the server from the concurrent threads.

But the first hurdle to be cleared is, whether it is possible to run 300,000 threads on a PC? Here is a code which I am using to see intially how many max threads I can get, and later then replace the test function with the actual function:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace CheckThread
{
    class Program
    {
        static int count;

        public static void TestThread(int i)
        {
            while (true)
            {
                Console.Write("\rThread Executing : {0}", i);
                Thread.Sleep(500);
            }
        }

        static void Main(string[] args)
        {
            count = 0;
            int limit = 0;
            if (args.Length != 1)
            {
                Console.WriteLine("Usage CheckThread <number of threads>");
                return;
            }
            else
            {
                limit = Convert.ToInt32(args[0]);
            }
            Console.WriteLine();
            while (count < limit)
            {
                ThreadStart newThread = new ThreadStart(delegate { TestThread(count); });
                Thread mythread = new Thread(newThread);
                mythread.Start();
                Console.WriteLine("Thread # {0}", count++);
            }

            while (true)
            {
                Thread.Sleep(30*1000);
            }
        } // end of main
    } // end of CheckThread class
} // end of namespace

Now what I am trying might be unrealistic, but still, if there is a way out to do it and you know, then please help me.

  • 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-05-23T01:55:29+00:00Added an answer on May 23, 2026 at 1:55 am

    Each thread will create its own stack and local storage, you are looking at roughly 512k of stack space per thread on a 32bit OS, I think the stack space doubles on a 64 bit OS. A quick back of the spreadsheet calc gives us 146.484375 gigs of stack space for your 300k clients.

    So, no, don’t create 300k threads, but rather use the threadpool to simulate 300k requests, although tbh I think you would be better off with several test clients spamming your server through a network interface.

    There are a lot of web load-testing tools available. Good starting point : http://www.webperformance.com/library/reports/TestingAspDotNet/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a PhoneGap Windows Phone 7 application. In order to imitate
Basically what I am trying to do is to imitate the replace button with
I am trying to imitate this tutorial about creating a simple Apple-themed breadcrumb found
I'm trying to program two buttons to imitate the up/down arrow key behavior, meaning
I'm trying to implement my own little flow-based layout engine. It should imitate the
I am trying to perform a cURL request (either directly from shell or via
I am trying to obtain some information from a webpage that requires login. I
I'm trying to create my custom toolbox which imitates jQuery's design pattern. Basically, the
i am trying to imitate the sample given with using autofac, but constantly getting
Trying to connect to a SQL Server 2005 instance remotely but getting the following

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.