Go's concurrency model uses goroutines, and is very powerful. One of the drawbacks of having high concurrency is that you will experience difficulty when you attempt to debug that high-concurrency model. To avoid this difficulty, the language creators created go tool trace. They then distributed this in Go version 1.5 in order to be able to investigate and resolve concurrency issues. The Go tracing tool hooks into the goroutine scheduler so that it can produce meaningful information about goroutines. Some of the implementation details that you may want to investigate with Go tracing include the following:
- Latency
- Contention of resources
- Poor parallelism
- I/O-related events
- Syscalls
- Channels
- Locks
- Garbage Collection (GC)
- Goroutines
Troubleshooting all of these issues will help you to build a more resilient distributed system. In the next...