TCP and SCTP support. SCTP support relies on kernel SCTP implementation and external github.com/ishidawataru/sctp
package and is currently tested and enabled for Go 1.8+ and x86 Linux
go-diameter requires at least Go 1.4.
Make sure Go is installed, and both GOPATH and GOROOT are set.
go get github.com/fiorix/go-diameter/diam
Check out the examples:
See the test cases for more specific examples.
Clients and servers written with the go-diameter package can be quite
performant if done well. Besides Go benchmarks, the package ships with
a simple benchmark tool to help testing servers and identifying bottlenecks.
In the examples directory, the server has a pprof (http server) that
allows the go pprof tool to profile the server in real time. The client
can perform benchmarks using the -bench command line flag.
For better performance, avoid logging diameter messages. Although logging
is very useful for debugging purposes, it kills performance due to a number
of conversions to make messages look pretty. If you run benchmarks on the
example server, make sure to use the -s (silent) command line switch.
TLS degrades performance a bit, as well as reflection (Unmarshal). Those are
important trade offs you might have to consider.
Besides this, the source code (and sub-packages) have function benchmarks
that can help you understand what’s fast and isn’t. You will see that
parsing messages is much slower than writing them, for example. This is
because in order to parse messages it makes numerous dictionary lookups
for AVP types, to be able to decode them. Encoding messages require less
lookups and is generally simpler, thus faster.