How many threads is too many?

前端 未结 12 674
死守一世寂寞
死守一世寂寞 2020-11-22 16:49

I am writing a server, and I send each action of into a separate thread when the request is received. I do this because almost every request makes a database query. I am usi

12条回答
  •  清酒与你
    2020-11-22 17:29

    As Pax rightly said, measure, don't guess. That what I did for DNSwitness and the results were suprising: the ideal number of threads was much higher than I thought, something like 15,000 threads to get the fastest results.

    Of course, it depends on many things, that's why you must measure yourself.

    Complete measures (in French only) in Combien de fils d'exécution ?.

提交回复
热议问题