Thursday, March 20

How can we define in weblogic configuration how many concurrent users are allowed or can be allowed at a time to a particular application?



You can user Work Managers to do this for managing requests. However, restricting the number of concurrent users will vary application to application. If it is a web app, use the work managers with a max constraint equal to the number of users you want to restrict it to.

If to each user you assign a session, then you can control the max number of sessions in your webapp weblogic descriptor,for example adding the following constraint :

12

It's more effective (if you mean 1 user = 1session) than limiting the number of requests by work managers.

Another way, when you can't predict the size of sessions and the number of users, is to adjust memory overloading parameters and set :

weblogic.management.configuration.WebAppContainerMBean.OverloadProtectionEnabled.

2) how can we tell how may threads are being used in a weblogic at a time?

Ideally you would want a 1:1 ratio of threads to connections in the pool. This guarantees that no thread (User Request) is waiting for a connection. You can monitor the JDBC connection pools using the WebLogic console and adding fields to the columns under the 'Monitoring' tab for the connection. If you have a high number of waiters, and/or a high wait time then you would want to increase the number of connections in the pool. You could start with a 1:0.75 ratio of threads:connections, do performance/load testing and adjust based on your findings. It really depends on how well you manage the connections. Do you release the connection immediately after you get the data from the database, or do you proceed with application logic and release the connection at the end of the method/logic? If you hold the connection for a long time you will likely need closer to a 1:1 ratio.

3) How many max jdbc connections should I set so that users are not blocked due to all connections used up. How to keep a balance between number of concurrent user/threads allowed to jdbc connections max?

Usually, adapting the number of JDBC connections to the number of threads is the more effective.

No comments:

Post a Comment