C.1. Tuning the SGD Gateway

When you install the SGD Gateway, default values for the maximum number of simultaneous Adaptive Internet Protocol (AIP) and HTTP connections are configured automatically, based on the available memory on the SGD Gateway host. The memory size allocated to the SGD Gateway's Java Virtual Machine (JVM) is also optimized for this number of connections.

After installing the SGD Gateway, depending on the expected number of SGD users and the number of applications they will run, you can adjust the default settings. When you do this, you might also need to adjust the JVM memory size. This process is called tuning the SGD Gateway.

Caution

If the JVM memory size is too low for the expected number of connections, the SGD Gateway might stop working and refuse all subsequent connections. In this case, you need to tune the SGD Gateway so that sufficient JVM memory is available. A java.lang.OutOfMemoryError error message on the SGD Gateway indicates that tuning might be required.

To tune the SGD Gateway, you do the following:

C.1.1. Changing the Maximum Number of AIP Connections

The maximum number of AIP connections is configured at install time. The default setting depends on the memory resources available on the SGD Gateway host.

You can change this setting to a value more appropriate for your deployment. See Section C.1.1.1, “Calculating the Number of AIP Connections” for details of how to calculate the maximum number of AIP connections used by an SGD Gateway.

To change the maximum number of AIP connections, use the --routes-aip-maxcon option of the gateway config edit command. For example, to change the maximum number of AIP connections to 3000, run the following command:

# /opt/SUNWsgdg/bin/gateway config edit --routes-aip-maxcon 3000

You must restart the SGD Gateway to enable any changes you make.

C.1.1.1. Calculating the Number of AIP Connections

The number of AIP connections used by an SGD Gateway depends on the number of concurrent SGD users, and the number of applications they run, as follows:

Number of AIP connections = (number of applications + 3) x number of SGD users

For example, an SGD Gateway with 1000 SGD users, each running four applications requires the following maximum number of simultaneous AIP connections:

(4 + 3) x 1000 = 7000 AIP connections

C.1.2. Changing the Maximum Number of HTTP Connections

The maximum number of HTTP connections is configured at install time. This setting defines the maximum number of concurrent users. The default value is 100.

To change the maximum number of HTTP connections, use the --routes-http-maxcon option of the gateway config edit command. For example, to change the maximum number of HTTP connections to 200, run the following command:

# /opt/SUNWsgdg/bin/gateway config edit --routes-http-maxcon 200

You must restart the SGD Gateway to enable any changes you make.

C.1.3. Changing the JVM Memory Size

When you change the maximum number of AIP and HTTP connections, you might need to change the memory size allocated to the SGD Gateway's JVM. To do this, edit the following settings in the /opt/SUNWsgdg/proxy/etc/tuning_parameters file:

  • -Xms – Initial memory size for the JVM, in bytes

  • -Xmx – Maximum memory size for the JVM, in bytes

Tip

You can use the K (kilo) and M (mega) modifiers with these settings. For example: 960K = 960 kilobytes, and 512M = 512 megabytes.

See Section C.1.3.1, “Calculating the JVM Memory Size” for details of how to calculate JVM memory size values.

Note

Ensure that your system is configured with sufficient memory resources for the JVM settings you make.

You must restart the SGD Gateway to enable any changes you make.

C.1.3.1. Calculating the JVM Memory Size

The amount of JVM memory used by the SGD Gateway depends on the number of simultaneous AIP connections and HTTP connections.

As each SGD Gateway connection requires approximately 300 kilobytes of JVM memory, the required JVM memory is given by:

(number of AIP connections + number of HTTP connections) x 300 kilobytes

For example, an SGD Gateway with 500 SGD users, each running two applications. The maximum number of simultaneous AIP connections is:

(2 + 3) x 500 = 2500 AIP connections

The SGD Gateway must also handle sufficient simultaneous HTTP connections to the SGD Web Server. For this example, the maximum number of HTTP connections is:

250 HTTP connections

So, the required JVM memory is:

(2500 + 250) x 300 kilobytes = 806 Megabytes, approximately.

Note

In the /opt/SUNWsgdg/proxy/etc/tuning_parameters file, set the -Xms and -Xmx parameters to the calculated JVM memory value. -Xms and -Xmx are normally set to be the same value for performance reasons.