Skip to content

[Packetbeat] High CPU usage in PGSQL Decoder #12150

@andrewkroh

Description

@andrewkroh

Packetbeat is using a lot of CPU time while processing pgsql protocol data. CPU profiling shows that much of this time can be attributed to the copious logging statements (even while debug logging is off).

(pprof) list isSpecialPgsqlCommand
Total: 29.95s
ROUTINE ======================== github.com/elastic/beats/packetbeat/protos/pgsql.isSpecialPgsqlCommand in github.com/elastic/beats/packetbeat/protos/pgsql/parse.go
     6.47s     26.23s (flat, cum) 87.58% of Total
             .          .    680:       // Startup Message
     2.89s     19.27s    681:       logp.Debug("pgsqldetailed", "Startup Message, length=%d", length)
     1.02s      1.02s    682:       return true, length, startupMessage

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions