0

I am trying to stress test my Endpoint which works with dapper that calls procedure and has a lot of validation. Idea is to know how it can handle like 1000 API calls that was sent at the same time.

Note that it is Get Endpoint

Any idea?

I tried using thread pool, but it would not run 1000 of them at the same time, also I thought about Task but it was same here, also for loop is not option with tasks or anything else, because there still will be the time difference between each method run.

8
  • Are we talking about a cloud service? Commented Jul 23, 2023 at 6:32
  • ^^ if so, you could also make test consumers and scale those up until your desired load is reached. Commented Jul 23, 2023 at 6:36
  • "I tried using thread pool, but it would not run 1000 of them at the same time" -- Try calling before ThreadPool.SetMinThreads(1000, 10), and see if it makes any difference. Commented Jul 23, 2023 at 6:36
  • what about this? int numberOfCalls = 1000; List<Task> tasks = new List<Task>(); for (int i = 0; i < numberOfCalls; i++) { // Create a new task and add it to the list tasks.Add(SendApiCallAsync()); } // Wait for all tasks to complete await Task.WhenAll(tasks); Commented Jul 23, 2023 at 6:41
  • Would you do that on the same machine, @VivekNuna ? Commented Jul 23, 2023 at 6:52

1 Answer 1

1

I would suggest using dedicated load testing tools like K6 or Bombardier. You run all your infrastructure including the service/system you are tryng to test locally or in cloud and then run the load testing tools against your service.

PS: Bombardier might be easier if you just have to make quick HTTPGET endpoint calls

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.