Skip to content

Commit 3255e61

Browse files
authored
Merge pull request #167 from DataDog/remeh/max-packets-sze
[README] add a section on the maximum packets size knob
2 parents 57ab447 + 62ddbc5 commit 3255e61

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,30 @@ In very high throughput environments it is possible to improve performance by ch
106106
- `sysctl -w net.unix.max_dgram_qlen=X` - Set datagram queue size to X (default value is usually 10).
107107
- `sysctl -w net.core.wmem_max=X` - Set the max size of the send buffer for all the host sockets.
108108

109+
### Maximum packets size in high-throughput scenarios
110+
111+
In order to have the most efficient use of this library in high-throughput scenarios,
112+
default values for the maximum packets size have already been set to have the best
113+
usage of the underlying network.
114+
However, if you perfectly know your network and you know that a different value for the maximum packets
115+
size should be used, you can set it with the option `WithMaxBytesPerPayload`. Example:
116+
117+
```go
118+
package main
119+
120+
import (
121+
"log"
122+
"github.com/DataDog/datadog-go/statsd"
123+
)
124+
125+
func main() {
126+
statsd, err := statsd.New("127.0.0.1:8125", WithMaxBytesPerPayload(4096))
127+
if err != nil {
128+
log.Fatal(err)
129+
}
130+
}
131+
```
132+
109133
## Development
110134

111135
Run the tests with:

0 commit comments

Comments
 (0)