Posted on 2014-12-08
Medium Priority
Last Modified: 2014-12-09
Hi Experts,

I'm doing a simulation of a bunch of sessions that do 3 or 4 REST calls.  I'd like to do as many as possible simultaneously that won't start degrading the machine and give diminishing performance.  I don't care to make it right at the critical point, but I'm wondering what's a good number of threads to use?  I'm thinking 150 is likely a good number.

Thanks for any advice,
Question by:thready
  • 2
  • 2
LVL 36

Expert Comment

ID: 40488148
I'm wondering what's a good number of threads to use?
We aren't going to be able to give you the answer that you are seeking. What is a good number for your particular situation would be a totally different number for the next persons. I mean you haven't even given any detail about what it is that you are doing AND even if you had it is very unlikely that anyone could give you a number you are looking for.

SO... what would I do in your situation? Firstly, you mention "give diminishing performance" so I would make sure that you have some way of measuring performance. And then it is a case of trial and error to see what you can get out of it before you performance begins to "diminish"
LVL 28

Expert Comment

ID: 40488330
If you want maximum throughput you generally only want about twice as many threads as cores on your CPU - so you're looking at maybe 10 rather than 150.  But that's assuming you're not going to be blocking and waiting for I/O - which it sounds like you will be if you're making REST calls?  In that case it really depends how long the REST calls take to respond and whether the threads will block waiting for the response.

So the answer is "it depends".

Like mccarl said - not really enough info here to help you much.

Author Comment

ID: 40488380
Yes, the threads will block while waiting for responses, but that's just because it's easier to program this way- each of the 3 or 4 REST calls are sequential...  Of course I could have chained the asynch callbacks instead...  So I'm guessing a definite minimum is about 100 threads for this reason.  I did something similar about ten years ago and since then computers have gotten faster, and I think my magic number was at about 150.  Of course, the two servers are doing different things, but they're basically the same amount of work.
Anyway, I knew this was a vague question....  I'm just fishing for out of the box thinking.  Among other things, I was hoping for someone to tell me about something that can add the correct number of threads based on performance, but that's a whole other ball game...
LVL 28

Accepted Solution

dpearson earned 2000 total points
ID: 40489720
can take a minimum and maximum thread pool size and figures out how many threads to actually use, based on the way the tasks execute and block.

It may be what you're looking for?


Author Closing Comment

ID: 40490432
Awesome!  Thank you!

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
A discussion about automated testing of Web Applications utilizing Selenium, along with illustrated configuration steps for the Jenkins open source tool.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question