Skip to content

coderd allocates large amounts of memory under high ReconnectingPTY traffic load #8071

Closed
@johnstcn

Description

@johnstcn

When sending moderate amounts of ReconnectingPTY traffic to coderd, we observe high memory usage that eventually is released once the load drops.

image

This is the result of sending approximately 4MiB/s of ReconnectingPTY traffic to coderd (4096 kB @ 10Hz).

We see memory usage rise up to approx 5GiB and then drop off after the traffic subsides.

A pprof sample taken at 15:36 (indicated by the blue line) shows a high proportion of memory usage by device.PopulatePools:

github.com/tailscale/wireguard-go/device.(*WaitPool).Get
/home/runner/go/pkg/mod/github.com/tailscale/wireguard-go@v0.0.0-20221219190806-4fa124729667/device/pools.go

  Total:           0     3.92GB (flat, cum) 97.76%
     36            .     3.92GB           ??? 

Pprof available here:

cian-jun12-heap.pprof.gz
cian-jun12-goroutine.pprof.gz

Metadata

Metadata

Assignees

Labels

networkingArea: networkingscaletestIssues related to scale testing.staleThis issue is like stale bread.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions