• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Values for connection pool parameters

 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I want to use a connection pool given in the book "Core Servlets" by Marty Hall.
I was wondering if there are guidelines for values to be used for a connection
pool. I understand that it might be different values depending upon the
application's nature and load but if there are any recommended values for
configuring database connection pool then it would be helpful.

I am interested in following parameters,
1. initialConnections
2. maxConnections

Can anybody help me?

You can assume some application's number of requests etc and specify what would be good values for above two parameters for that assumption.

Thanks
Maulin
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For production mode it makes sense to set initalSize = maxSize. Also, size of the pool should be equal at least maximum number of simultaneous requests (there is a config parameter in tomcat's server.xml connector stanza, maxProcessors.

HTH
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Slava

Thank you very much for the information. Yes, it makes sense that we configure pool by looking at what our webserver can also handle It would not probably make sense to support no of connections more than number of requests webserver can handle

Regards,
Maulin
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Slava Imeshev:
For production mode it makes sense to set initalSize = maxSize. Also, size of the pool should be equal at least maximum number of simultaneous requests (there is a config parameter in tomcat's server.xml connector stanza, maxProcessors.

HTH



Not sure I agree on setting initalSize = maxSize. Due to the nature of ConnectionPools, if another connection is likely to be needed, they can open it just in case rather than holding the Connection open. Setting the values different would allow the pool to grow and shrink as dictated by demand, and may have an effect on the load on the application server and database server.

Note that this is all based on gut-feel and I have absolutely no empirical data to back it up.

It is also worth noting that matching web connections to database connections may not be the best initial match. If database operations are typically short, you may be able to set database connections to a tenth of what the web server accepts. Also keep in mind that a single web connection may possibly require several database connections at once.

Just random thoughts, really.

Dave.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic