Coder Social home page Coder Social logo

Comments (1)

xplicit avatar xplicit commented on May 24, 2024

ThreadPool config values just an example and you should tune these values according to your application usage. If it creates alot of parallel network requests you should increase number of IO threads. If application creates large number parallel threads via ThreadPool.QueueUserWorkitem you should increase number of worker threads. Also you can set all these values to "0" to get default ThreadPool settings.

When the new request arrived ThreadPoolchecks if there is available thread in pool and if thread is not available it tries to create new one. This is very costly operation and degrades performance alot. If number of created threads hit the max threads value then ThreadPool stops to create new threads and wait when previous will be completed. You should monitor you app to be sure that threads are not created on every request and total number of threads in normal conditions is unchanged (if you do not create threads directly with Thread.Start).

My experiments shows that default number of worker threads is very low for high-load application and should be increased. These values from sample hfc.config are good for 2-core processor without active ThreadPool usage in services. So if you have more cores or actively use external calls you are definitely have to change these values to more large values.

Settings
<threads min-worker="40" max-worker="0" min-io="4" max-io="0" />

points to minWorkerThreads, maxWorkerThreads, minIOThreads and maxIOThreads settings in ThreadPool.

Finally, you should monitor threads numbers (via counters for example) in your application and find the best settings according to your usage.

Also it could be the situation when application does not return threads to the threadpool, if you have a simple example which shows the issue I will look in it.

from hyperfastcgi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.