Servers to support 1000 concurrent users

Hi, I read in the forum that Cuba platform can support 1000 concurrent users. What would the specs for the application servers be to support 1000 concurrent users ? 2 servers with Intel XEON Quad Core processors at 3Ghz with 16GB each running TOMCAT with 64-bits JDK, with a load balancer in front ? I saw that to support 100k concurrent users, we will need 500GB, for 1000 concurrent users, I will need 5GB RAM. Divided into 2 servers I can setup Tomcat with 3GB heap space using 64-bits JDK, right ?

Thanks
CK

1 Like

Hardware requirements highly depend on the nature of your application. The platform just imposes some common rules on predicting requirements:

  • Database load does not directly depend on the number of users, it depends on the number of requests per second and complexity of queries.
  • Middleware is stateless, so its memory consumption is relatively low and does not directly depend on the number of users. CPU load depends on the number of requests from clients and background processes.
  • Web Client requires memory in direct proportion to the number of concurrent users and complexity of screens. We recommend at least 5MB of heap per user.
    Middleware and Web Client servers can be scaled horizontally.

As a starting point, I can provide the hardware configuration for our document management system (Thesis ECM, see https://www.thesis-ecm.com) with 3000 concurrent users:
Load Balancer: 1 server with 2xCore CPU, 3.5GB RAM, SATA
Web Client: 3 servers, each with 4xCore CPU, 28GB RAM, SATA
Middleware: 1 server with 8xCore CPU, 28GB RAM, SATA
Database (PostgreSQL): 1 server with 16xCore CPU, 112GB RAM, SSD
All servers run in Microsoft Azure cloud.

1 Like

Thanks. That is a very useful answer. Just to clarify, why do I need a Middleware server ? What do I install on it ? I have used Cuba platform app running on 1 server with TOMCAT to run the WAR file generated and a separate DB server. The TOMCAT server is the Web Client server correct ?

CK

> why do I need a Middleware server ? … I have used Cuba platform app running on 1 server with TOMCAT to run the WAR file generated…

That’s a good question. As you may know, any CUBA application consists of at least two “blocks” - Middleware and Web Client. Middleware contains business logic, Web Client is a default front-end. This separation exists not only in the development stage but in the running application too, no matter how it is assembled. Even if you run a single WAR file, the blocks are still separated by classloaders. Tomcat (or any other Java web server) is a container for both blocks, it provides Servlet API and other means for running web applications. If you run Middleware on a separate server, it will also be a Tomcat, because the Middleware block is actually a web application without front-end.

In a simple case, you can run Middleware and Web Client on a single machine, either as separate web apps or in a single WAR. But when you need to scale your system by adding more servers, you will have to organize communication between Middleware blocks to synchronize various caches (entity cache, locks, app properties cache and others). The more servers you have, the more intensive is the communication and more config files you have to support. At the same time, Middleware blocks do not need to be scaled at the same proportion as Web Client blocks as I explained in my previous comment. So it is logical for a situation when you need more than 2 Web Client servers to have a separate Middleware blocks cluster with up to 2 servers (for fault-tolerance).

See also the Application Scaling documentation.

I had looked at the Application Scaling document. In “Stage 4. A cluster of Web Client servers working with a cluster of Middleware servers”, there are 4 tomcat servers, 2 for the Web Client and 2 For the Middleware. And also there is synchronization between the middleware servers. Can I put 1 Web Client and 1 Middleware service on 1 host (i.e. Tomcat 1 and 3 in HOST 1 and Tomcat 2 and 4 in HOST 2) ? Then I only need 2 HOSTS and I still have High Availability.

CK

Sure, you can run several Tomcat servers on one host, just assign different port numbers to them.

With just 2 GB of RAM and a 2 Core Processor, we are able to manage our site examtray to handle 1000-1400 simultaneous users. You are using a server with 16GB of RAM that can hold many users without rejecting or signing out existing users on the site.
You should employ cache systems like MemCache or Varnish to take advantage.
It also depends on the number of Unauthenticated users and Authenticated Users. Konstantin mentioned to calculate 5MB per user. Even that is also a good suggestion as 1GB of RAM can hold 200 heavy users.