Skip to content
Snippets Groups Projects
Commit c44e135a authored by Corné Lukken's avatar Corné Lukken
Browse files

Merge branch 'L2SS-1538-annotate-udp-buffer' into 'master'

L2SS-1538: Explain how to increase UDP buffer size

Closes L2SS-1538

See merge request !748
parents 0da37e29 3cc33b3e
No related branches found
No related tags found
1 merge request!748L2SS-1538: Explain how to increase UDP buffer size
...@@ -83,11 +83,15 @@ class UDPReceiver(Thread, StatisticsClientThread): ...@@ -83,11 +83,15 @@ class UDPReceiver(Thread, StatisticsClientThread):
) )
if self.parameters["recv_buffer_size"] < self.options["recv_buffer_size"]: if self.parameters["recv_buffer_size"] < self.options["recv_buffer_size"]:
# Typically this is the host OS not allowing us to allocate buffers
# of this size. Try increasing it using (as root):
# sysctl -w net.core.rmem_max=$((16*1024*1024))
logger.error( logger.error(
f"OS does not allow requested buffer size. " f"OS does not allow requested buffer size. "
f"This could result in UDP packet loss. " f"This could result in UDP packet loss. "
f'Requested {self.options["recv_buffer_size"]} bytes, ' f'Requested {self.options["recv_buffer_size"]} bytes, '
f'got {self.parameters["recv_buffer_size"]}.' f'got {self.parameters["recv_buffer_size"]}. Verify '
f'if "sysctl net.core.rmem_max" is sufficiently large.'
) )
# specify what host and port to listen on # specify what host and port to listen on
......
...@@ -58,6 +58,7 @@ class Statistics(OPCUADevice): ...@@ -58,6 +58,7 @@ class Statistics(OPCUADevice):
) )
# size of UDP receive buffer # size of UDP receive buffer
udp_recv_buffer_size_R = AttributeWrapper( udp_recv_buffer_size_R = AttributeWrapper(
doc="Buffer size for receiving UDP packets.",
comms_id=StatisticsClient, comms_id=StatisticsClient,
comms_annotation={"type": "udp", "parameter": "recv_buffer_size"}, comms_annotation={"type": "udp", "parameter": "recv_buffer_size"},
datatype=numpy.uint64, datatype=numpy.uint64,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment