Copy link to clipboard
Copied
Can we say that number of threads created in an application should be equal to number of cores of a Processor. Say, I should create maximum two threads if I have a dual core machine or four threads if I have a quad-core machine etc.??.
Copy link to clipboard
Copied
No, there's no such direct connection. Consider how many cf requests can run at once (not tied to number of cores), or more simply how many programs can run at once on your desktop or laptop computer, or indeed your phone or mobile device.
Computers and modern OSs are inherently mutli-threaded--meaning they can do more than one thing at a time. If you implement suitable monitors you can see that literally millions of operations happen per minute.
And when it comes to cf threads or requests, the limiter is almost never the cpu cores, but rather its whatever may make a thread or request slow...and if many become slow, then you will see (with a suitable cf monitor) that eventually you reach whatever may be the limit set in cf for the max number of threads or requests are allowed to run.
In that case, the solution isn't (usually) to raise either limit, but instead to find whatever may be the cause of the hanging of the threads or requests. In my nearly 15 years of doing such cf server troubleshooting, I've not seen the count of cores to be the cause of such slowness.
Again, with suitable cf monitoring, you can see what would be the true cause of such slowness. I've done many blog posts and conference talks over the years on this topic (of cf monitoring), showing free and built-in tools as well as 3rd party ones. Indeed, see my last one from last month, at carehart.org/presentations, on the very topic of monitoring alternatives.
Don't get me wrong: I totally understand why one might ask the question, and I hope this has helped you with not just an educated opinion but also a way for you to get to the bottom of your curiosity.
Copy link to clipboard
Copied
Me9, any thoughts?