Free speedy-node websocket conn. often disconnects


I’ve had contact with support but they pointed me to this tech. forum, so here goes my question:

I’ve been using the Moralis Speedy Nodes websocket connections for one of my projects. It’s been ok, but I’m experiencing frequent disconnects. I wouldn’t mind paying for a more stable connection, but I’m wondering if the provided Pro Plan node is actually different or will be suffering from the same problems?

To be clear: I know the Pro plan allows more messages to be sent; but that’s not what i care about. I care about a reliable connection to the node.

I’m connecting from nodejs using the web3 client. This is my connection setup:

const provider = new Web3.providers.WebsocketProvider('wss://', {
    timeout: 30000, // ms
    clientConfig: {
        maxReceivedFrameSize: 100000000,
        maxReceivedMessageSize: 100000000,
        keepalive: true,
        keepaliveInterval: 15000 // ms
    reconnect: {
        auto: true,
        delay: 15000, // ms
        maxAttempts: 3,
        onTimeout: false

I keep getting these:

"message": "CONNECTION ERROR: The connection got closed with the close code '4040' and the following reason string 'Draining connection'"

I’ve tried both with and without reconnects, but both fail and require me te setup the connection again.

this could happen when the node that you are connected with the web socket goes offline, this is expected to happen from time to time, but it shouldn’t be too frequent.

how often do you get this Draining connection error? and you could also connect again after you get that error?

It’s differs per day, sometimes it’s okay for an hour or 2. But for example today I see disconnects every couple of minutes. To make matters worse, sometime connecting also fails, so I have to have a timeout to detect that happening and try to reconnect again.

Today it’s very bad again, disconnects and problems connecting all the time. Please advise on what I can do.

Like I said, I wouldn’t mind paying for a speedy node. but I’d like to know it won’t have the same problems and is actually a different/better node.

Or if there is anything I can do to help you debug this let me know as well.

I’ll test a connection for 1 hour to see how fast it disconnects

at this moment paid version works better compared to the free version, at least for the web sockets, but this is mostly because it looks like the free version has some problems today

Ok, thanks for testing. It’s not just today thought, I promise :wink: