Skip to content

Out of memory (OOM) on low ram devices #464

@salvatorebattiato

Description

@salvatorebattiato

I'm trying to move from a sing-box vless over ws configuration to wstunnel, since it's a simpler yet effective solution for my case. I have a Xiaomi AX3000T router wired to a firewalled network with a real bw of 700MBit/s and connecting to my vps with 4000Mbit/s real bw via cloudflare cdn. The inbound for the wstunnel is tproxy. The program goes out of memory in load intensive situations (like speedtests and parallel downloads), right after around 128MB ram usage.

Sing-box is able to provide a consistent 200MBit/s speedtests with plain ws to my vps (privacy is not my concern, since all my traffic is already tls encrypted) using around 32MB memory while wstunnel pushes to 360+ Mbit/s before crashing at 130+ MB memory usage. The router has no swap memory capability, since there's no usb available. I'm pretty sure that sing-box go websocket implementation is worse than rust fastwebsockets in terms of performance, but for some reason the backpressure in the ws implementation is not driven by any memory usage constraint.

I'll study a bit the codebase and see if i can suggest a pr. But for now, i'm leaving this as bug report

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions