Child pages
  • Tuning the Server

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
JVM servermode on Windows 32-bit
JVM servermode on Windows 32-bit

On Windows 32 bit environments, the Java Runtime Environment does not include support for server mode. In order to take advantage of server mode optimizations on 32 bit Windows systems, it is required to install Java Development Kit (JDK)

Memory

Processes in Java, like the Servoy Application Server, need to be told explicitly the maximum of memory they are allowed to use. This setting, the maximum heap size, is important to adjust to the load the Servoy Application Server is to handle.

The maximum heap size setting is located in {servoy_install}/application_server/servoy_server.sh/.bat, through the "Xmx" setting.

When the Application Server is started as a Service the setting can be found in {servoy_install}/application_server/service/wrapper.conf, by the name of "wrapper.java.maxmemory".

By default the maximum heap size is set to 256MB. This setting should be changed when:

  • The actual used memory is >= 70% of the specified maximum. The actually used memory can be found on the main page of the Admin page, under System Information, like: Heap memory: allocated=549184K, used=371473K, max=699072K
  • When the expected client load will exceed the maximum: As a rule of thumb:
    • Smart Client: assume a memory usage of about 600kb for each Smart Client. NOTE: When the Servoy HTTP Tunnel is used, assume 900kb per Client.
    • All other type of Clients (Web, Headless, Batch): the required memory for each client depends on the size and design of the solution, but should be in the order of magnitude of a couple of Mb per Client.
  • When there is plenty of free real memory available on the OS level. Java processes in general perform better when not having memory constraints. For example, when 2Gb free real memory is left, add the 2Gb to the maximum heap size. The Java process will only take what it needs.

Database Connection Pool Tuning

The Servoy Application Server uses a pool of database connections per configured Database Server. 

The maximum number of active and idle connections within a pool is configurable to preserve resources. For example, a single connection could easily take up a couple of Mb, both on the Servoy Application Server side, as well as on the database engine side.

The settings are configurable on the Servoy Admin page, under Database Servers:

  • Maximum connections active: the maximum number of connections that can be created within the pool.
    If set too low, handling requests towards the database might slow down, as one request needs to wait until another request is processed and the connection is returned to the pool
    If set too high, the exceptions might occur if the database cannot handle that many concurrent connections or if more memory is required than is available
  • Maximum connections idle: the maximum number of inactive or idle connections in the pool
    Active connections that are done processing a request are returned to the connection pool as idle connections. If the number of idle connections goes over the maximum, the connections are removed.
    As instantiating new connections takes time, the value shouldn't be too low. On the other side idle connections take up resources, so the number shouldn't be too high either.

The maximum number of active connections is also limited by the maximum number of connections the database itself is configured to allow. For the bundled PostgreSQL database engine, the maximum is 100 connections. However, these 100 connections are for all connections made to the database instance. This means that if there are multiple Database Servers defined on the Servoy Application Server which are all hosted on the same database instance, the max. 100 connections are for all Database Servers combined. This must be taken into account when setting up the maximun number of active connections.

By default, the maximum active connections setting is set to 10. This could be too low when serving may clients from one Application Server or when the clients do many requests to the database. As rule of thumb, if the actual used active connection regularly goes above 70% of the maximum a higher number of maximum active connections should be configured.See Memory Management

Database Connection Pool Tuning

See Connection Pooling in the Database Connections chapter

Database Tuning

Architecture

...