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.

26 Responses to Connection Pool vs. Thread Pool Settings

  1. kalyan says:

    Excellent explanation, Thanks a lot.

  2. Lutherea says:

    Приветик.
    Хочу поделиться с вами.
    Знаю такие зарубежные сайты.
    Популярную пример айфона 6 можно заполучить совершенно бесплатно.
    Регистрация для нём простая.
    здесь вами потребуется выполнить всего одно задание.
    Разумеется,пригласите своих знакомых.
    Теперь вами будут начисленны баллы.
    Сейчас Обменивайте своих баллы на выбранный телефон.
    На любом сайте зарегистрируйтесь. http://apple.freebiejeebies.co.uk/1081440%5Dайфон6 , http://www.winogo.com/?ref=h3dvxrciайфон6plus , http://www.xpango.com?ref=93154579iphone6lus
    Видете как всё просто!!!

  3. Battler says:

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

  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 а также 15fifa.ru скачать фифа

  7. Judyver says:

    In my opinion it already was discussed


    In my opinion you commit an error. 14yo girls, flexible girls, more girls tickle

  8. KennethPruth says:

    I apologise, but, in my opinion, you are mistaken. Let’s discuss it. Write to me in PM, we will talk.


    I consider, that you are mistaken. I can defend the position. Write to me in PM. viagra wamali, pirkt viagra а также kitznkatz-deutschland best viagra

  9. Mikecloxy says:

    In my opinion, it is an interesting question, I will take part in discussion. I know, that together we can come to a right answer.


    I will know, many thanks for an explanation. raped porn online, online private porn, Hard porn videos from Stepdad online indian porn

  10. ToniTek says:

    I can not participate now in discussion – it is very occupied. But I will return – I will necessarily write that I think.


    You have hit the mark. Thought excellent, it agree with you. filme romanesti gratis online hd, filme ru hd а также https://kinokiste.cx/filmen-genre-stream/thriller/ filme auf youtube hd

  11. DougFully says:

    Счастье мне изменило!


    Мне кажется это очень хорошая идея. Полностью с Вами соглашусь. http viagra, viagra phorum а также http://sinwald.de classic viagra

  12. Brianlob says:

    You are not right. I am assured. I can prove it. Write to me in PM, we will communicate.


    Completely I share your opinion. I think, what is it excellent idea. miami tv live stream, online tv stream live, https://liveschauen.com/14-rtl-nitro-live-stream-kostenlos-online-ohne-anmeldung.html live tv stream fox

  13. VictoriaGam says:

    You were visited with simply excellent idea


    I join. I agree with told all above. We can communicate on this theme. Here or in PM. shop viagra, viagra 2, Job-Green viagra stories

  14. Rodneydeato says:

    It is remarkable, this valuable opinion


    To speak on this question it is possible long. 25 viagra, cvs viagra, http://www.pillsverige.com viagra p

  15. Angieintah says:

    Bravo, seems magnificent idea to me is


    I apologise, but, in my opinion, you are not right. Let’s discuss. Write to me in PM. viagra stories, mens viagra, https://rhoenklub-walddoerfer.de viagra sexy

  16. Nicolepouse says:

    Yes, thanks


    What words… super, a remarkable phrase wiki viagra, 3 viagra, hendrik-tzschaschel getting viagra

  17. LindsayFek says:

    The matchless theme, very much is pleasant to me :)


    Willingly I accept. The theme is interesting, I will take part in discussion. vip escort agency, escort agency elite, more here starting an escort agency

  18. MarquelDak says:

    In it something is. Now all is clear, thanks for the help in this question.


    It is remarkable, very valuable phrase viagra drugs, viagra online, http://www.heygeneva.com viagra pirkt

  19. KristyPoish says:

    I can suggest to visit to you a site on which there are many articles on a theme interesting you.


    I apologise, but, in my opinion, you are mistaken. I can defend the position. Write to me in PM, we will communicate. viagra qiymeti, facebook viagra, erek dysfunkce viagra haber

  20. Adamszex says:

    You were visited with excellent idea


    It is remarkable, rather useful phrase erotic porn, sleeping porn, Ramming massage porn

  21. Susandiuse says:

    Excellent phrase


    What touching a phrase :) dildo porn, porn hairy, Nasty porn dota

  22. MarianneVed says:

    It is possible to speak infinitely on this theme.


    It was and with me. Let’s discuss this question. Here or in PM. porn loli, porn old, Dude tentacle porn

  23. DebbieNuM says:

    It you have correctly told :)


    This idea is necessary just by the way porn вк, porn russian, German porn comix

  24. Lawrenchaura says:

    This day, as if on purpose


    I apologise, but, in my opinion, you are not right. Write to me in PM. porn forum, porn boy, https://www.ass2moutch.com/ porn private

  25. nik says:

    a real way to earn money online реальный способ заработать в интернете how to earn money on the affiliate program способ заработать на партнерской программе

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: