Skip to content

Profiling & Diagnostics

RUSEON Core provides robust debugging tools isolated on a separate port for security.

Built-in Profiling Server

Profiling is handled by a separate HTTP server bound strictly to localhost. It is enabled by setting server.pprof_port in your config (set to 0 to disable).

Endpoints available:

  • /debug/pprof/
  • /debug/pprof/cmdline
  • /debug/pprof/profile (CPU profile)
  • /debug/pprof/symbol
  • /debug/pprof/trace (Execution trace)

Security

The pprof server must NEVER be exposed externally, as it can leak source code paths, memory contents, and allow denial of service via heavy trace requests.

Using Go Tool Pprof

To capture a 30-second CPU profile from the server:

bash
go tool pprof http://localhost:<pprof_port>/debug/pprof/profile?seconds=30

To view heap memory allocations:

bash
go tool pprof http://localhost:<pprof_port>/debug/pprof/heap

Statsviz

When debug: true is enabled, RUSEON Core also mounts the statsviz handler on the main HTTP server, providing real-time WebSocket-driven graphs of GC pauses, memory usage, and goroutines at /debug/statsviz/.

Released under the MIT License.