Connection Pool vs. Thread Pool Settings

Connection Pool and Thread Pool are used to improve performance of applications. Most of us use these poolings with default settings not caring about their configurations or finding optimal values. But the configuration also an important factor in performance tuning. In some sense the connection pool and the thread pool settings are dependent. We will discuss about the dependency in this post.

The dependency between these two pool setting is in maximum attribute. Let us assume that your database can support maximum of 50 connections then it is straight forward to configure the connection pool maximum attribute as 50. But how this setting going to impact thread pool setting? Configure application server thread pool as maximum of 100. In this scenario application server will allow 100 request to be processed simultaneously however database have only 50 connections. So only 50 thread will get connection another 50 thread will fight to get database connection hence connections will be switched between threads frequently that will slow down overall application performance.

Let us assume we set thread pool maximum setting same as connection pool maximum setting of 50. Application server will allow 50 thread to be processed simultaneously the remaining thread will be in wait state. All the 50 thread will get database connection immediately hence it will be processed quickly.

The above example assumed each thread will use one database connection (may be multiple connections but sequentially); if your application uses two database connections parallelly by each thread then configure thread pool maximum setting as half of the connection pool maximum.

Finally, setting the thread pool size too large can cause performance problems because if there are too many concurrent threads, task switching overhead becomes a serious bottleneck.

Some tips to configure pools.

  1. Determine the optimal value of maximum thread and maximum connection from performance test.
  2. Set the value of initial capacity equivalent to maximum capacity.

15 Responses to Connection Pool vs. Thread Pool Settings

  1. kalyan says:

    Excellent explanation, Thanks a lot.

  2. Lutherea says:

    Хочу поделиться с вами.
    Знаю такие зарубежные сайты.
    Популярную пример айфона 6 можно заполучить совершенно бесплатно.
    Регистрация для нём простая.
    здесь вами потребуется выполнить всего одно задание.
    Разумеется,пригласите своих знакомых.
    Теперь вами будут начисленны баллы.
    Сейчас Обменивайте своих баллы на выбранный телефон.
    На любом сайте зарегистрируйтесь.айфон6 ,айфон6plus ,
    Видете как всё просто!!!

  3. Battler says:

    Если умеешь моделить и есть желание поучаствовать в создании своей игры, приходи к нам:

  4. Matthew Felzani says:

    i think it’s important to note that the above info needs to be evaluated in the context of how much db demand your system has. in most systems the DB interaction is a very small portion of the execution — so the thread will do many other things. so part of the tuning exercise is to understand the relative demand of the thread on the db. for example, in the “100 threads / 50 connections” example you may have identical performance results with just 5 connections if the overall db demand of the system is small.

  5. Rajat says:

    Is there an approach\calculator to define initial values for Thread Pool\Connection pool values for an all new application . How to identify initial set of value to start with baseline tests . Any relation with server resources OR OS limits .

  6. Stacyheere says:

    Замечательно, очень забавная фраза

    а вобщем смешно. скачать фифа, скачать fifa а также скачать фифа

  7. Anitaabany says:

    Всем привет я только узнал что в 1xbet появился увеличенный бонус и что, для его получения, требуется специальный промокод. Какой промокод на 1xbet нужно вводить?

  8. Paulaplesy says:

    Quite right! Idea excellent, it agree with you.

    The amusing moment go movies, bd movies, mini movies

  9. CynthiaCob says:

    In my opinion you commit an error.

    I consider, that you are not right. I can prove it. Write to me in PM, we will talk. enjoy movies, xxl movies, los movies

  10. Wendyrig says:

    I consider, what is it very interesting theme. Give with you we will communicate in PM.

    Certainly. And I have faced it. flashback movies, movies dp, x movies

  11. SandyReuch says:

    The phrase is removed

    I confirm. And I have faced it. Let’s discuss this question. Here or in PM. movies nude, movies abused, adults movies

  12. GabrielCoich says:

    I suggest you to visit a site, with an information large quantity on a theme interesting you.

    I recommend to you to visit a site on which there is a lot of information on this question. movies heroin, 300mb movies, enema movies

  13. Duywek says:

    Easier on turns!

    It to you a science. gesundheit leben, gesundheit der akademie или Weinhandel Leipzig скачать gesundheit

  14. LauraNug says:

    What remarkable question

    I congratulate, it seems brilliant idea to me is lviv escort, escort white, this site boy escort

  15. NikkiGok says:

    Yes, you have truly told

    Bravo, this magnificent idea is necessary just by the way gabi berlin, berlin saturn а также transport berlin

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: