Skip to content

Commit

Permalink
Add reusing of UDP ports
Browse files Browse the repository at this point in the history
  • Loading branch information
g41797 committed Nov 1, 2023
1 parent 6563940 commit 362cd96
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,24 @@ type SyslogConfiguration struct {
ROOT_CA_PATH string
}
```
For os with support of **SO_REUSEPORT** socket option, sidecar opens simultaneously
8 UDP ports:
```sh
sudo netstat --tcp --udp --listening --programs --numeric|grep 5141
tcp 0 0 127.0.0.1:5141 0.0.0.0:* LISTEN 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
udp 0 0 127.0.0.1:5141 0.0.0.0:* 63457/./syslog-e2e
```

[it is intended to improve the performance of multithreaded network server applications running on top of multicore systems](https://lwn.net/Articles/542629/) and decrease number of dropped UDP messages (see [syslog udp message loss](https://axoflow.com/syslog-over-udp-message-loss-1/#))


## Plugins

There are 3 kinds of broker specific plugins:
Expand Down Expand Up @@ -364,8 +382,10 @@ You can use [starter](https://github.com/g41797/sputnik/blob/main/sidecar/starte

Production:
- [sputnik](https://github.com/g41797/sputnik)
- fork of [gonfig](https://github.com/tkanos/gonfig)
- fork of [go-syslog](https://github.com/mcuadros/go-syslog)
- fork of [gonfig](https://github.com/tkanos/gonfig)
- fork of [go-reuseport](https://github.com/libp2p/go-reuseport)


Tests:
- [srslog](https://github.com/RackSec/srslog)
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ require (
github.com/RackSec/srslog v0.0.0-20180709174129-a4725f04ec91
github.com/RoaringBitmap/roaring v1.5.0
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
github.com/g41797/go-syslog v1.0.7
github.com/g41797/go-syslog v1.0.8
github.com/g41797/kissngoqueue v0.1.5
github.com/g41797/sputnik v0.0.17
)

require (
github.com/bits-and-blooms/bitset v1.2.0 // indirect
github.com/g41797/gonfig v1.0.1 // indirect
github.com/g41797/reuseport v0.4.3 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/mschoch/smat v0.2.0 // indirect
golang.org/x/sys v0.13.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
10 changes: 7 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjL
github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/g41797/go-syslog v1.0.7 h1:ktpiFvBwrG5YFhlq5zG+0lZeEJYZAyZaoNeeXapzv7w=
github.com/g41797/go-syslog v1.0.7/go.mod h1:UTVoy1HHCeTQrHszeHyQquF0hbqU8anfc2Lqr3ZgXkg=
github.com/g41797/go-syslog v1.0.8 h1:JqQsGeQnCqsuuJUaVXzEs58JVYyxCG5LTDN99XEPFsE=
github.com/g41797/go-syslog v1.0.8/go.mod h1:sKo/XQbhH7rd5HF07k2jly6ecVL3JTediGp0GmkAaZA=
github.com/g41797/gonfig v1.0.1 h1:ywgkhF3SbNJuFN9Hlm9n7Lp+KxqeupkNmFObn2ZpWs8=
github.com/g41797/gonfig v1.0.1/go.mod h1:5iL4oHFpYi+c7AE4D1dZnlBleJzM71dX6HZBhEELF90=
github.com/g41797/kissngoqueue v0.1.5 h1:UrnpxbjOnTnKj/EqpbLA9LjhYkHjnLWMZQqsz3AOBG8=
github.com/g41797/kissngoqueue v0.1.5/go.mod h1:c1mGfrNWfEP2cHeX04Iji8qYGQevvUmZw5SPZM5M9Cs=
github.com/g41797/reuseport v0.4.3 h1:PiDDvf8Jzn+BXjHKTgRVrg7W7TmqRQl+YJBfFhyQ4K8=
github.com/g41797/reuseport v0.4.3/go.mod h1:YspHTQtcQs/c6t4geFSzo0TN13ZtUY6HOYPMKynuvpU=
github.com/g41797/sputnik v0.0.17 h1:HBDFPgpMBaZHD1YY5Vjtfy6IVVigq31lN6WmK3KmG48=
github.com/g41797/sputnik v0.0.17/go.mod h1:nhuXjBz9tK1Myi+LVaTpLodWdMuquayrdcgJO6O+5dA=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
Expand All @@ -24,10 +26,12 @@ github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down

0 comments on commit 362cd96

Please sign in to comment.