3.10 Estimating resources
Estimate the total resource requirements by summing the estimated shared memory size, number of processes, threads, and file descriptors, as well as the estimated database capacity.
Estimating the size of the shared memory
The following describes how to estimate the size of the shared memory used by the web server and the performance tracer.
- Size of the shared memory used by the web server
-
The size of the shared memory used by the web server is calculated as described below.
Note that the size of the shared memory used by the web server is the same as the size of shared memory segments.
Size of shared memory used by web server = 409,600 + 7,168 * MaxRequestWorkers
Legend:
MaxRequestWorkers: Maximum number (bytes) of clients that can be connected concurrently
- Size of the shared memory used by the performance tracer
-
The size of the shared memory used by the performance tracer is calculated as described below.
Note that the size of the shared memory used by the performance tracer is the same as the size of shared memory segments.
Size of shared memory used by performance tracer = value_specified_for_PrfTraceBufferSize * 1,024 + 18,496
- Legend:
-
value_specified_for_PrfTraceBufferSize: Trace buffer size (bytes) for the performance tracer retained in the shared memory
Estimating the number of processes
The following describes how to estimate the number of processes for the Java EE server, the web server, and performance tracer.
- Number of Java EE server processes
-
The number of resident Java EE server processes is calculated as follows:
Number of Java EE server resident processes = number_of_domain_management_servers + number_of_server_instances
- Number of web server processes
-
The number of web server processes is calculated as follows:
Number of web server processes = control_processes + server_processes + CGI_processes + gcache_server + rotatelogs_processes + rotatelogs2_processes
- Legend:
-
control_processes: 1
server_processes: Number of the specified MaxRequestWorkers directives
CGI_processes: Number of server processes
gcache_server: 1
rotatelogs_processes: Number of rotatelogs programs specified for the CustomLog directive, the ErrorLog directive, the HWSRequestLog directive, and the TransferLog directive
rotatelogs2_processes: Number of rotatelogs2 programs specified for the CustomLog directive, the ErrorLog directive, the HWSRequestLog directive, and the TransferLog directive
- Number of performance tracer processes
-
The number of resident performance tracer processes is 1.
Estimating the number of threads
The following describes how to estimate the numbers of threads for the Java EE server, the web server, and performance tracer.
- Number of Java EE server threads
-
The number of threads to be used by the Java EE server is calculated as follows:
- Legend:
-
Dt: Total number of threads for each domain management server process
SIt: Total number of threads for each server instance process
m: Number of domain management server processes
n: Number of server instance processes
To calculate the total number of threads for each domain management server process (Dt) and the total number of threads for each server instance process (SIt), use one of the following formulas:
- Legend:
-
Tm: Maximum value for thread pools
Tn: Number of threads that do not belong to thread pools. Among these threads, 44 threads are created by default by, for example, the domain administration server and server instance.
m: Number of thread pools for domain management servers
n: Number of thread pools for server instances
- Number of web servers threads
-
The number of threads used by the web server is the same as the number of processes used by the web server.
- Number of performance tracer threads
-
The number of threads used by performance tracer is 10.
Estimating the number of file descriptors
This subsection describes how to estimate the number of file descriptors for the Java EE server, web server, and performance tracer.
- Number of file descriptors for the Java EE server
-
The number of file descriptors for the Java EE server increases or decreases according to the issuance of OS system calls such as open() and socket(). In addition, the number of file descriptors varies depending on the number of concurrent connections of DBMS.
The method for estimating the number of file descriptors used by the Java EE server based on the maximum number of concurrent connections of DBMS is described here.
To calculate the number of file descriptors used by the Java EE server, use the following formula:
Number of Java EE server file descriptors = JDBC_connection_pool_size x 2
- Number of file descriptors for the web server
-
To calculate the number of file descriptors used by the web server, use the following formula:
-
For Linux
Number of file descriptors used by the web server = (50 + A x B + C + 11 x C x D + 8 x E + (F + H) x G) x 1.2
- Legend:
-
A: Number of the specified Listen directives (If the Listen directive is not specified, use the value 1.)
B: Number of IP addresses assigned to the host
C: Total number of the CustomLog, ErrorLog, HWSRequestLog, and TransferLog directives that you specified
D: Use 1 if you use the rotatelogs or rotatelogs2 program, and use 0 if you do not use either program.
F: Set 3 if you use SSL, and set 2 if you do not use SSL.
G: Number of concurrent execution requests (This is the value specified for MaxRequestWorkers.)
H: Set 1 if you use the reverse proxy, and set 0 if you do not use the reverse proxy.
Note that the number of file descriptors used in external modules that are not contained in CGI programs or the web server is not included.
-
- Number of file descriptors for performance tracer
-
Set 32 or a greater value for the number of file descriptors used when performance tracer starts.
Estimating database capacity
If you want to use the EJB timer service and Java Batch as functions of Application Server, DBMS is required. DBMS stores the DDL file where table information is defined. Based on the table information of this DDL file, estimate the database capacity.
The following table shows where the DDL files necessary for estimation are stored.
No. |
Target |
Storage directory |
File name |
DBMS |
---|---|---|---|---|
1 |
EJB timer service |
installation_directory_for_Application_Server/javaee/glassfish/lib/install/databases |
ejbtimer_oracle.sql |
Oracle |