We have this application with a fairly large number of hits, in which some views definitely need optimizing.
From everything I see online, the recommendation is generally to have 2 * num_core + 1 workers, and up to 4 threads per worker... but I really can't find anything that explains why you should limit the number of threads to 4.
Most of the requests are fast enough, but less than 1% does take longer than 5 seconds or so, and during peak use, if multiple users call the slow views, the site generally seems to degrade.
Is it bad to say screw 4, launch 40 threads per worker, while we work on the actual optimizations?
All the settings page says for both workers and threads is:
A positive integer generally in the 2-4 x $(NUM_CORES) range. You’ll want to vary this a bit to find the best for your particular application’s work load.
The views are IO, not CPU bound.
Does anyone have any good references that explain why everyone says to use 4, or is it a "it was recommended once, so now we all repeat it because it's all we've ever known" kinda deal?