Lots of Concurrent Users - Slowdown

We have a system that generally runs between 500-650 concurrent users during peak time. We have two servers, one that houses the SQL Server and the other contains both the Cuba Middle-ware and Client. In monitoring memory usage and CPU usage the application appears to be running well, but when trying to open a complicated view it can take up to 30 seconds sometimes. I ran a SQL Profiler here and it’s about 0.1 seconds total for the resources being pulled for the view when it takes 12 seconds to load the view. When under less load the views return in 1-2 seconds so this tells me something is going on in the Middle-ware or the client. My questions are as follows:

  1. Is there anything in settings that I should be adjusting to accommodate more concurrent users?
  2. When does it make sense to scale with additional servers vs. increasing CPU cores and RAM?
  3. Is there locking or something that occurs in the application that will cause a slowdown with many users? Will scaling servers help with this?
  4. I noticed in the Performance Statistics that database active connections is maxed at 20. Am I reading this correctly? Is there a way to change this? We’ve allowed for more concurrent connections in our previous application than 20 as this helped alleviate a bottle neck in the application.

Any type of suggestion or answer here would be much appreciated. Thanks.

Hi,

First of all, both default Tomcat settings and default platform settings are for development. You should always change them in production for your expected load.

If you have a lot of users you should tune your:

  • database server - usually it is the main problem in real life installations
  • DB connection pool size in Tomcat
  • HTTP connection pool size in Tomcat

After that you should profile your setup and collect pain points. Start with performance logs - open your perfstat.log and perfstat-ui.log files and see if anything run slowly.

Then you can decide if you need to scale your middleware cluster or just add 2-more web clients. It is heavily dependent on your load profile. Maybe you don’t need a cluster at all.

Please note, that all the Tomcat options related to performance (for instance APR native connector) as well as Java garbage collection settings are applied for CUBA applications. You can tune them if needed.