andrea-magni / MARS

MARS-Curiosity Delphi REST Library
Mozilla Public License 2.0
362 stars 113 forks source link

ThreadPoolSize #137

Closed ertankucukoglu closed 11 months ago

ertankucukoglu commented 1 year ago

Hello,

I wonder what ThreadPoolSize is used for. Does it related to database connection pool size? Or, does it related to max simultaneous connection quantity?

My concern is to increase simultaneous connections so I am trying to understand how I can do that or there is no need at all?

Thanks for clarifications.

Regards, Ertan

andrea-magni commented 11 months ago

Hi @ertankucukoglu , ThreadPoolSize is the size of the thread pool used to handle incoming requests. It is simply a surfacing of Indy's TIdSchedulerOfThreadPool.PoolSize property (TIdHttpServer). As you can read in Indy's documentation:

PoolSize is an Integer property that indicates the number of thread instances to allocate to the internal thread pool for a thread-based scheduler. The default value for PoolSize is 0, as assigned during initialization of the component, and indicates that no thread instances are allocated to the internal thread pool. ... Setting PoolSize to a large value will lead to longer load times.

Setting the value in PoolSize after a server has become active will result in thread instances being accumulated after execution in the thread pool until the number in PoolSize is reached.

Sincerely, Andrea