Performance issues
To help troubleshoot performance issues, NXLog Agent provides several ways to output server information and log processing status.
The easiest method is to use signals to send instructions to the NXLog Agent process.
By sending SIGUSR1
on Linux-based operating systems and SC
code 200 on Windows, you instruct NXLog Agent to write a status summary to the log file.
The summary includes the status of each module instance and its queue size, which can help you identify if an instance is a bottleneck.
2024-06-27 18:44:19 INFO [CORE|main] event queue has 2 events;
jobgroup with priority 1;non-module job, events: 0;
jobgroup with priority 10;job of module null/im_null, events: 0;job of module tcp_routing/im_tcp, events: 1; POLL: 1;job of module file_1/om_file, events: 0;job of module file_2/om_file, events: 0;
jobgroup with priority 99;non-module job, events: 0;non-module job, events: 0;non-module job, events: 0;non-module job, events: 0;non-module job, events: 0;non-module job, events: 0;non-module job, events: 0;non-module job, events: 0;
[route 1]; - tcp_routing: type INPUT, status: RUNNING queuesize: 0; - file_1: type OUTPUT, status: RUNNING queuesize: 0;
[route 2]; - null: type INPUT, status: RUNNING queuesize: 0; - file_2: type OUTPUT, status: RUNNING queuesize: 0;
See Getting NXLog Agent status information for more information on sending signals.
Another option is to use the Remote Management (xm_admin) module to be able to request NXLog Agent status information via HTTP(S). This module provides the ServerInfo endpoint for retrieving detailed NXLog Agent status information.
You can send HTTP requests to the agent using a utility like curl. In addition, any third-party system or application monitoring tool can integrate with NXLog Agent.
{
"response": "serverInfoReply",
"status": "success",
"data": {
"server-info": {
"started": 1719509187559441,
"load": 0.21999999880790710449,
"pid": 11452,
"mem": 6119424,
"os": "Linux",
"version": "5.5.7638",
"systeminfo": "OS: Linux, Hostname: NXLog-1, Release: 5.15.0-46-generic, Version: #49~20.04.1-Ubuntu SMP Thu Jun 27 19:26:27 UTC 2024, Arch: x86_64, 1 CPU(s), 1.9Gb memory",
"hostname": "NXLog-1",
"servertime": 1719509449614052,
"modules": {
"tcp_1": {
"module_name": "tcp_1",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"queuesize": 0,
"queuelimit": 0,
"batchsize": 50,
"status": 3,
"module-type": 1,
"module": "im_tcp",
"tcp": {
"current-listener-count": 1,
"listeners": [
{
"address": "0.0.0.0",
"port": 1514
}
],
"current-connection-count": 0,
"cumulative-connection-count": 0
},
"variables": {}
},
"tcp_2": {
"module_name": "tcp_2",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"queuesize": 0,
"queuelimit": 0,
"batchsize": 50,
"status": 3,
"module-type": 1,
"module": "im_tcp",
"tcp": {
"current-listener-count": 1,
"listeners": [
{
"address": "0.0.0.0",
"port": 1514
}
],
"current-connection-count": 0,
"cumulative-connection-count": 0
},
"variables": {}
},
"output_file": {
"module_name": "output_file",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"queuesize": 0,
"queuelimit": 100,
"batchsize": 0,
"status": 3,
"module-type": 3,
"module": "om_file",
"variables": {}
}
},
"labels": {},
"extensions": {
"admin": {
"module-name": "admin",
"module": "xm_admin"
}
},
"routes": {
"1": {
"route-modules": {
"tcp_1": {
"module_name": "tcp_1",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"queuesize": 0,
"queuelimit": 0,
"batchsize": 50,
"status": 3,
"module-type": 1,
"module": "im_tcp",
"tcp": {
"current-listener-count": 1,
"listeners": [
{
"address": "0.0.0.0",
"port": 1514
}
],
"current-connection-count": 0,
"cumulative-connection-count": 0
},
"variables": {}
},
"tcp_2": {
"module_name": "tcp_2",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"queuesize": 0,
"queuelimit": 0,
"batchsize": 50,
"status": 3,
"module-type": 1,
"module": "im_tcp",
"tcp": {
"current-listener-count": 1,
"listeners": [
{
"address": "0.0.0.0",
"port": 1514
}
],
"current-connection-count": 0,
"cumulative-connection-count": 0
},
"variables": {}
},
"output_file": {
"module_name": "output_file",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"queuesize": 0,
"queuelimit": 100,
"batchsize": 0,
"status": 3,
"module-type": 3,
"module": "om_file",
"variables": {}
}
},
"route-name": "1",
"evt-recvd": 0,
"evt-drop": 0,
"evt-fwd": 0,
"in-use": "true"
}
}
}
}
}
See the configuration examples in the xm_admin reference to configure NXLog Agent with this module.
Troubleshooting performance issues in a live environment may be challenging. A better option is to simulate the load in a segregated test environment, allowing you to troubleshoot without affecting business operations. See Generating test data for several options to simulate input data.