4.2.9 Collecting the internal trace (hwstraceinfo command)

When an application program is executed and a request is received, the events that occur in the system are collected as internal trace. The internal trace is output once to the shared memory, and then it is output to the file as per the specification in the directive or command.

[Figure]

Organization of this subsection
(1) Collecting trace information
(2) How to output to a file
(3) hwstraceinfo command
(4) Points to be noted when releasing shared memory and restarting (UNIX Version)

(1) Collecting trace information

Internal traces are collected in the shared memory when various events occur in the Web server. The memory identifiers of shared memory are stored in the file specified in the HWSTraceIdFile directive.

(2) How to output to a file

The internal trace that is collected in the shared memory is output to a file when the server process terminates abnormally or when the hwstraceinfo command is executed. When the server process terminates abnormally, the trace is output to the file specified in the HWSTraceLogFile directive.

Specify the memory identifier and file name of output destination, in the hwstraceinfo command. For the UNIX version, only the user specified in the User directive or the superuser can execute the hwstraceinfo command. For the Windows version, only the user with administrative permission can execute the hwstraceinfo utility.

The internal trace information output file size is as follows:

For the UNIX version
Output size of the ps -efl command + output size of the vmstat command + output size of the ipcs -a command + 7 KB [Figure] MaxClient value
For the Windows version
7 KB [Figure] ThreadPerChild value

(3) hwstraceinfo command

This section describes how to specify the hwstraceinfo command.

(a) Format

hwstraceinfo -i shared-memory-identifier {-l file-name|-r}

(b) Parameters
(c) Usage example

The following is an example to output the trace corresponding to the shared memory identifier 1800_1133780652_0, to the traceinfo.log file:

hwstraceinfo -i 1800_1133780652​_0 -l traceinfo.log

(4) Points to be noted when releasing shared memory and restarting (UNIX Version)

To retain trace information, the Web server does not release the shared memory even when the Web server stops. The shared memory is reused when the server restarts.

When you stop the server and restart it later, the Web server releases the shared memory once and then restores it depending upon the file value specified in the HWSTraceIdFile directive. However, in the following cases, the shared memory used earlier cannot be released:

When you release the shared memory, execute the hwstraceinfo command in which -r is specified.