db connection pool size & concurrent users

Discussions

Performance and scalability: db connection pool size & concurrent users

  1. db connection pool size & concurrent users (4 messages)

    for an application that heavily accesses the database, should the connection pool size equal the number of concurrent users you want to support? for example, if i want to support 500 concurrent users, what should my db pool size be?
  2. When you say "500 concurrent users", do you mean:

    A) 500 concurrent sessions
    B) 500 concurrent HTTP requests

    Do you have a cluster of app servers or a single app server?
  3. .[ Go to top ]

    500 concurrent http requests. the site will have 20000 users. currently we are using a single appserver. I would also appreciate some tips on load testing, like some good trialware or free tools. right now, we are using the ms web stress tool to simulate users.
  4. for an application that heavily accesses the database, should the connection pool size equal the number of concurrent users you want to support? for example, if i want to support 500 concurrent users, what should my db pool size be?
    It all depends...

    You say you have 500 concurrent http requests. How much of the time of processing the requests is spent on database connectivity? If a typical request spends 50% of its time doing calculations and 50% on database connectivity you might only need 250 connections in your pool. Of course your application should release the db connection as early as possible.

    In general holding a connection is not expensive for a database (while creating a new one is quite expensive). It should be no problem to keep the size high enough.

    Load testing: If you have a web application with such a high number of concurrent users, I think there is no way around using a professional and supported (!= trial) load testing product.

    Andreas
    http://www.triona.de/
  5. yes, it depends.

    you want the connection pool big enough so that you never run out of connections in the pool....but no bigger. this size will depend on the application and usage patterns. i suppose it is even possible to need more connections than users if each session is running multiple sql statements.

    running realistic multi-user use-case scenarios ...with wait times...for the mix of user activities you expect will likely require a good tool such as mercury interactive's loadrunner. there may be usage spikes in the morning...say when everybody logs in...or on friday...or at the end of a fiscal quarter that you need to account for. also, how you set assumptions...such as wait times...can also vary your results a good deal.

    mike