Configuration Optimization for EzyPlatform

Updated at 1770367842000
After successfully deploying EzyPlatform, you can adjust the configuration to optimize the resources that EzyPlatform uses.

Disable socket if you don't use it

If you are not using any socket plugins, you can turn it off and disable it to prevent the browser from trying to connect.

Optimize admin configuration

Depending on the traffic level, you should choose an appropriate configuration.

Max heap size configuration.

In the VM Options section of the admin dashboard you can add:
MAX_HEAP_SIZE=256m
Or
-Xmx256m
Here 256m is the maximum heap size that admin will use. Normally 256m is enough, but if you have dozens of admins accessing concurrently you should increase it to 512m. If you have hundreds of concurrent admins you should increase it to 1024m.

ActiveProcessorCount flag configuration

In Java, many libraries rely on this flag to create thread pools, for example the number of threads in a pool can be 4 x ActiveProcessorCount. This flag may not reflect the actual number of CPU cores Java uses; it can be greater than or equal to 1. In most cases the admin module needs very few threads because it does not process many requests, so it should be kept at the minimum. Therefore you can set:
-XX:ActiveProcessorCount=1
In VMOptions.

Request handling thread configuration

If fewer than 10 admins access concurrently, you can configure the minimum and maximum request handling threads as:
server.min_threads=2
server.max_threads=4
If there are dozens of admins, you can set:
server.min_threads=4
server.max_threads=8
If there are hundreds of admins, you can set:
server.min_threads=8
server.max_threads=16

Other configurations

By default, the number of threads for file download is ActiveProcessorCount. You can increase or decrease it depending on the number of concurrent admins. Normally you should keep the default. If only a few admins access concurrently, you should set:
resources.download.thread_pool_size=1
If a few dozen admins access concurrently, you should set:
resources.download.thread_pool_size=2
If a few hundred admins access concurrently, you should set:
resources.download.thread_pool_size=4
Similarly, you can configure the number of threads for file upload:
resources.upload.thread_pool_size=1

Optimize web configuration

Similar to admin, depending on traffic you should choose an appropriate configuration.

Max heap size configuration.

In the VM Options section of the web dashboard you can add:
MAX_HEAP_SIZE=512m
Or
-Xmx512m
Here 512m is the maximum heap size that web will use. Normally 512m is enough, but if you have hundreds of concurrent users you should increase it to at least 1024m.

ActiveProcessorCount flag configuration

If only a few dozen users access concurrently, the web module needs very few threads because it does not process many requests, so it should be kept at the minimum. Therefore you can set:
-XX:ActiveProcessorCount=1
But when there are hundreds of concurrent users, you should set:
-XX:ActiveProcessorCount=4
If there are thousands of concurrent users, you should set:
-XX:ActiveProcessorCount=8
In VMOptions.

Request handling thread configuration

If fewer than 10 users access concurrently, you can configure:
server.min_threads=2
server.max_threads=4
If there are dozens of users, you can set:
server.min_threads=4
server.max_threads=8
If there are hundreds of admins, you can set:
server.min_threads=8
server.max_threads=16

Other configurations

Similar to admin, if there are few concurrent users you can set:
resources.download.thread_pool_size=1
If a few dozen users access concurrently:
resources.download.thread_pool_size=2
If a few hundred users access concurrently:
resources.download.thread_pool_size=4
Similarly, you can configure upload threads:
resources.upload.thread_pool_size=1

Optimize socket configuration

Similar to web, depending on traffic you should choose an appropriate configuration.

Max heap size configuration.

In the VM Options section of the web dashboard you can add:
MAX_HEAP_SIZE=256m
Or
-Xmx256m
Here 256m is the maximum heap size that socket will use. Normally 256m is enough, but if you have hundreds of concurrent users you should increase it to at least 512m.

ActiveProcessorCount flag configuration

If only a few dozen users access concurrently, the web module needs very few threads because it does not process many requests, so it should be kept at the minimum. Therefore you can set:
-XX:ActiveProcessorCount=1
But when there are hundreds of concurrent users, you should set:
-XX:ActiveProcessorCount=4
If there are thousands of concurrent users, you should set:
-XX:ActiveProcessorCount=8
In VMOptions.

Request handling thread configuration

EzyPlatform allows fairly deep customization of thread counts used by each category. At minimum you should set:
{
  "threadPoolSize": {
    "extensionRequestHandler": 1,
    "socketUserRemovalHandler": 1,
    "streamHandler": 1,
    "socketDisconnectionHandler": 1,
    "socketDataReceiver": 1,
    "statistics": 1,
    "systemRequestHandler": 1
  },
  "websocket": {
    "minHandlerThreadPoolSize": 4,
    "maxHandlerThreadPoolSize": 8,
    "writerThreadPoolSize": 1
  },
  "socket": {
    "writerThreadPoolSize": 1
  }
}
Then depending on CCU you can increase thread counts accordingly. For example, with 512 CCU you can increase to:
{
  "threadPoolSize": {
    "extensionRequestHandler": 4,
    "socketUserRemovalHandler": 1,
    "streamHandler": 4,
    "socketDisconnectionHandler": 1,
    "socketDataReceiver": 4,
    "statistics": 1,
    "systemRequestHandler": 2
  },
  "websocket": {
    "minHandlerThreadPoolSize": 4,
    "maxHandlerThreadPoolSize": 8,
    "writerThreadPoolSize": 1
  },
  "socket": {
    "writerThreadPoolSize": 4
  }
}

Table Of Contents