I'm running a node in dev mode: ./substrate/target/release/substrate --dev --tmp --ws-external

My client connection code:

provider = new WsProvider(wsProvider)
api = await new ApiPromise({ provider }).isReady;

I am testing an app using polkadot js api, and often connecting via ws. This has worked fine, except now when I connect it says the node is at full capacity:

2022-04-19 17:03:12 Unable to build WebSocket connection WS Error <Capacity>: Unable to add another connection to the event loop.

I assumed the disconnect event is fired when the client app closes, I'm not sure why it is full.

netstat shows a few ESTABLISHED connections from my ip, not sure why as I'm not currently even running the app.

  • 1
    Can you try adding: --ws-max-out-buffer-capacity=99999 --rpc-max-payload=99999 or something similar? Does this resolve the issue?
    – Shawn Tabrizi
    Apr 20, 2022 at 14:39
  • 1
    Pro tip: --dev implies --tmp for a while now, so it's redundant to use both :)
    – Nuke
    Apr 29, 2022 at 14:50
  • Can you also comment on where this node is hosted? Is it local and behind a firewall? do you see any peers or other connections? Can you provide detail on what you think those WS connections come from?
    – Nuke
    Apr 29, 2022 at 14:52
  • Hey, sorry I didn't update for a while. I just left it exposed for testing. I was using ufw but not blocking port 9944. Currently I'm migrating to a k8s setup with multiple ksm nodes being proxied by an nginx server, so that should be better. May 10, 2022 at 0:07
  • How often do you connecting via WS? Are you closing the connections or keeping the open? May 11, 2022 at 10:44

1 Answer 1


As @Shawn mentioned you can try --ws-max-out-buffer-capacity=99999

That worked for us

Also, I confirmed that the ws connection disconnects at either refresh or if you navigate away from the tab

You can see my discussion with Jago here

As noted, there has been a lot of work done on the 0.9.22 release to use the new jsonrpsee client that improves connections

Some nodes are already running this client

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.