Skip to content

Investigating performance issues

Alexander Emelin edited this page Nov 5, 2021 · 6 revisions

First step to investigate what's going on with your Centrifugo is looking at information provided by info command. There are 2 ways to get this information:

  • send info command with HTTP API client
  • send info command from actions tab of admin web interface

In general you should configure Centrifugo monitoring to periodically send Centrifugo metrics to external monitoring system.

But sometimes looking at metrics is not enough. In this case you can additionally capture CPU and heap profiles from running Centrifugo node.

To be able to do this Centrifugo must be run with debug configuration option enabled:

centrifugo --config=config.json --debug

Or with "debug": true in configuration file.

When debug enabled extra HTTP handlers become available on internal port.

Assuming your Centrifugo address is then go to and you will find debug information.

If you modified internal address or port when starting Centrifugo you should use that custom address and port to access debug data.

To capture CPU profile:

curl "" > /tmp/cpu.profile

To capture heap memory profile:

curl "" > /tmp/heap.profile

To capture goroutine dump:

curl "" > /tmp/goroutine1.txt

And also capture another one (with ?debug=2):

curl "" > /tmp/goroutine2.txt

All profiles can provide some insights to what's going on and why Centrifugo consumes a lot of memory or lot of CPU time. Goroutine profiles can help to find goroutine leaks or deadlocks.

There many articles describing how to work with profiles in Go, some of them:

But you can just show you profiles to us (please put profiles into ZIP archive before uploading). And also provide a configuration file (with obfuscated secrets).