Skip to content

Commit a387346

Browse files
authored
Merge pull request #8769 from wazuh/enhancement/8768-remoted-control-message-queue-management-update
Add memory management improvements for wazuh-remoted
2 parents 137902c + 227f0fc commit a387346

File tree

10 files changed

+36
-12
lines changed

10 files changed

+36
-12
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ All notable changes to this project will be documented in this file.
1313
- Added steps for installing a single node stack via Puppet in *Deployment with Puppet*. ([#8611](https://github.com/wazuh/wazuh-documentation/pull/8611))
1414
- Added information about filters in the Windows agent to block UNC and mapped drive paths to mitigate *NetNTLMv2* vulnerabilities. ([#8665](https://github.com/wazuh/wazuh-documentation/pull/8665))
1515
- Added the Wazuh global queries documentation. ([#8722](https://github.com/wazuh/wazuh-documentation/pull/8722))
16+
- Added `remoted.ctrl_msg_queue_size` internal option and new remoted statistics fields. ([#8769](https://github.com/wazuh/wazuh-documentation/pull/8769))
1617

1718
### Changed
1819

1920
- Updated the Available SCA policies section. ([#8602](https://github.com/wazuh/wazuh-documentation/pull/8602))
2021
- Added instructions for retrieving the correct Puppet agent node name and to set the ``<PUPPET_AGENT_NODE_NAME>`` placeholder in the manifest. ([#8664](https://github.com/wazuh/wazuh-documentation/pull/8664))
2122
- Updated the *Deployment on Docker* section. ([#8688](https://github.com/wazuh/wazuh-documentation/pull/8688))
23+
- Updated default values for `agents_disconnection_time` and `notify_time`. ([#8769](https://github.com/wazuh/wazuh-documentation/pull/8769))
2224

2325
## [v4.12.0]
2426

source/compliance/gdpr/gdpr-IV.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Wazuh server
137137
<email_to>[email protected]</email_to>
138138
<email_maxperhour>12</email_maxperhour>
139139
<email_log_source>alerts.log</email_log_source>
140-
<agents_disconnection_time>10m</agents_disconnection_time>
140+
<agents_disconnection_time>15m</agents_disconnection_time>
141141
<agents_disconnection_alert_time>0</agents_disconnection_alert_time>
142142
</global>
143143

source/user-manual/agent/agent-enrollment/agent-life-cycle.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In this phase, there are four different connection states that a Wazuh agent may
3636
- **Never connected**: The Wazuh agent has been enrolled but has not yet connected to the Wazuh manager.
3737
- **Pending**: The authentication process has not been completed because the Wazuh manager received a request for connection from the Wazuh agent but has not received anything else. The Wazuh agent will be in this state one time in its life cycle after each startup. If the Wazuh agent persists in this state, it may indicate a connectivity issue.
3838
- **Active**: The Wazuh agent has successfully connected and can now communicate with the Wazuh manager.
39-
- **Disconnected**: The Wazuh manager will consider the agent disconnected if it does not receive any ``keep alive`` messages within :ref:`agents_disconnection_time <reference_agents_disconnection_time>` (the default time is ``10m``).
39+
- **Disconnected**: The Wazuh manager will consider the agent disconnected if it does not receive any ``keep alive`` messages within :ref:`agents_disconnection_time <reference_agents_disconnection_time>` (the default time is ``15m``).
4040

4141
Removal
4242
-------

source/user-manual/manager/wazuh-server-queue.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ Below is an example of the content of the ``wazuh-remoted.state`` file:
140140
# Messages dequeued after the agent closes the connection
141141
dequeued_after_close='0'
142142
143+
# Control messages queue usage
144+
ctrl_msg_queue_usage='0'
145+
146+
# Control messages queue breakdown
147+
ctrl_msg_queue_inserted='5587'
148+
ctrl_msg_replaced='13'
149+
ctrl_msg_processed='5587'
150+
143151
Wazuh analysis engine queue (queue_and)
144152
---------------------------------------
145153

@@ -249,7 +257,7 @@ Run the command below on the Wazuh server to read the file:
249257
250258
# cat /var/ossec/var/run/wazuh-analysisd.state
251259
252-
Below is an example of the content of the wazuh-remoted.state file:
260+
Below is an example of the content of the wazuh-analysisd.state file:
253261

254262
.. code-block:: ini
255263

source/user-manual/reference/internal-options.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,14 @@ Remoted
863863
| | Allowed value | | Any other integer between 65536 and 1048576. |
864864
| | | | Powers of two are suggested. |
865865
+-----------------------------------+---------------+--------------------------------------------------------------+
866+
| **remoted.ctrl_msg_queue_size** | Description | Maximum number of control messages that can be queued for |
867+
| | | processing. When the queue reaches this limit, backpressure |
868+
| | | is applied to prevent memory exhaustion. |
869+
+ +---------------+--------------------------------------------------------------+
870+
| | Default value | 16384 |
871+
+ +---------------+--------------------------------------------------------------+
872+
| | Allowed value | Any integer between 1024 and 1048576. |
873+
+-----------------------------------+---------------+--------------------------------------------------------------+
866874
| **remoted.send_timeout_to_retry** | Description | | Maximum number of seconds to wait before retrying to |
867875
| | | | queue a packet to send in TCP. |
868876
+ +---------------+--------------------------------------------------------------+

source/user-manual/reference/ossec-conf/client.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ notify_time
153153
Specifies the time in seconds between agent checkins to the manager. More frequent checkins speed up dissemination of an updated ``agent.conf`` file to the agents, but may also put an undo load on the manager if there are a large number of agents.
154154

155155
+--------------------+-----------------------------+
156-
| **Default value** | 10 |
156+
| **Default value** | 20 |
157157
+--------------------+-----------------------------+
158158
| **Allowed values** | A positive number (seconds) |
159159
+--------------------+-----------------------------+
@@ -269,7 +269,7 @@ Sample link-local IPv6 configuration
269269
<protocol>tcp</protocol>
270270
</server>
271271
<config-profile>ubuntu, ubuntu22, ubuntu22.04</config-profile>
272-
<notify_time>10</notify_time>
272+
<notify_time>20</notify_time>
273273
<time-reconnect>60</time-reconnect>
274274
<auto_restart>yes</auto_restart>
275275
<crypto_method>aes</crypto_method>

source/user-manual/reference/ossec-conf/global.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ agents_disconnection_time
445445
This sets the time after which the manager considers an agent as disconnected since its last keepalive.
446446

447447
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
448-
| **Default value** | 10m |
448+
| **Default value** | 15m |
449449
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
450450
| **Allowed values** | A positive number that should end with a character indicating a time unit, such as: s (seconds), m (minutes), h (hours), d (days). The minimum allowed is 1s. |
451451
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -598,7 +598,7 @@ Configuration example
598598
<email_to>[email protected]</email_to>
599599
<email_maxperhour>12</email_maxperhour>
600600
<email_log_source>alerts.log</email_log_source>
601-
<agents_disconnection_time>10m</agents_disconnection_time>
601+
<agents_disconnection_time>15m</agents_disconnection_time>
602602
<agents_disconnection_alert_time>0</agents_disconnection_alert_time>
603603
<update_check>yes</update_check>
604604
</global>

source/user-manual/reference/statistics-files/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Agents statistical files:
1717

1818
Manager statistical files:
1919

20-
* :ref:`wazuh-remoted.state <wazuh_remoted_state_file>` - It shows information
20+
* :doc:`wazuh-remoted.state <wazuh-remoted-state>` - It shows information
2121
about the :ref:`remote daemon <wazuh-remoted>`
2222
* :ref:`wazuh-analysisd.state <wazuh_analysisd_state_file>` - It shows information
2323
about the :ref:`analysis daemon <wazuh-analysisd>`.

source/user-manual/reference/statistics-files/wazuh-remoted-state.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
.. meta::
44
:description: Learn how the wazuh-remoted.state file provides information about the remote daemon as the queue size, discarded messages, and other useful information.
55

6-
.. _wazuh_remoted_state_file:
7-
86
wazuh-remoted.state
97
===================
108

@@ -16,7 +14,7 @@ By default, this file is updated every 5 seconds. This interval can be changed b
1614

1715
Below there is an example of the content of the file:
1816

19-
.. code-block:: pkgconfig
17+
.. code-block:: ini
2018
2119
# State file for wazuh-remoted
2220
# Updated every 5 seconds.
@@ -47,3 +45,11 @@ Below there is an example of the content of the file:
4745
4846
# Messages dequeued after the agent closes the connection
4947
dequeued_after_close='487'
48+
49+
# Control messages queue usage
50+
ctrl_msg_queue_usage='0'
51+
52+
# Control messages queue breakdown
53+
ctrl_msg_queue_inserted='5587'
54+
ctrl_msg_queue_replaced='13'
55+
ctrl_msg_queue_processed='5587'

source/user-manual/wazuh-server-cluster/agent-connections.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Suppose we have the following IP addresses for the Wazuh server nodes:
5555
<protocol>tcp</protocol>
5656
</server>
5757
<config-profile>ubuntu, ubuntu18, ubuntu18.04</config-profile>
58-
<notify_time>10</notify_time>
58+
<notify_time>20</notify_time>
5959
<time-reconnect>60</time-reconnect>
6060
<auto_restart>yes</auto_restart>
6161
<crypto_method>aes</crypto_method>

0 commit comments

Comments
 (0)