Lost messages in heavy duty websocket client ?
I am listening to hundreds of streams at a 100ms interval and it looks like ratchet starts to swallow and lose messages (or return them in wrong order) when the processing is temporarily lagging behind by 100-200ms.
It's difficult to debug due to the gigabytes of data rolling through but I'm on this for about a week now and most likely the problem is Ratchet (+React).
The lag comes when a spike in traffic happens, it's not a problem IF the messages are buffered (I expected that).

I've tried various React loop implementations (the quickest was UV but it is unstable and crashes after a day), they all seem to have the same issue.

Is there a buffer limit ?
Is there a way to ensure the messages are processed in order (not sure if React guarantees that)?
Is there a way to check if messages got lost and can we avoid that ?


Update:
The order of messages is wrong it seems. I started tracking and it looks like ratchet does not guarantee that the queue of messages is played in the order it's received. 