Tyk Gateway Profiling
Last updated: 2 minutes read.
In some cases, to identify tricky issues like concurrency or memory related issues, it may be required to get information about the Gateway process runtime. For example, memory or CPU usage details. The Tyk Gateway is built using Go, and inherits its powerful profiling tools, specifically Google’s <code>pprof</code>.
The Tyk Gateway can generate various profiles in the pprof
supported format, which you can analyze by yourself, using the go tool pprof
command, or you can send the profiles to our support team for analysis.
There are two way to get profiles:
-
Running the process with flags mentioned below which will gather information about the running process for the first 30 seconds, and will generate files containing profiling info:
--memprofile
- memory profile, generatestyk.mprof
file--cpuprofile
- CPU usage profile, generatestyk.prof
file--blockprofile
- Blocking profile, generatestyk.blockprof
file--mutexprofile
- Mutex profile, generatestyk.mutexprof
file
-
Running with the
--httpprofile
flag, or setenable_http_profiler
totrue
in tyk.conf, which will run a special/debug/pprof/
public web page, containing dynamic information about the running process, and where you can download various profiles:- goroutine - stack traces of all current goroutines
- heap - a sampling of all heap allocations
- threadcreate - stack traces that led to the creation of new OS threads
- block - stack traces that led to blocking on synchronisation primitives
- mutex - stack traces of holders of contended mutexes