You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @walkor.
First of all thank you so much for your socket.io port.
I'm getting a lot of errors Error package. package_length= and started to investigate it. I found your posts about the client sending the wrong packet. This could be the reason, but I found another case. Im getting errors when worker's clients cross 7-10k connections.
public static function subscribe($events)
{
$events = (array)$events;
self::send(array('type' => 'subscribe', 'channels'=>$events));
foreach ($events as $event) {
if(!isset(self::$_events[$event])) {
self::$_events[$event] = null;
}
}
}
similar to this a:2:{s:4:"type";s:9:"subscribe";s:8:"channels";a:4:{i:0;s:12:"socket.io#/#";i:1;s:37:"socket.io#/#c66cbafbbf80d94105ab5045#";i:2;s:37:"socket.io#/#44dfbbfbbf80d941048015df#";i:3
which will definitely start hitting the packet size limit sooner or later.
Is it make sense for you? just want let people know, who will get same errors that the reason may not be due to wrong packet, but to a simpler reason of growth
This problem can be solved by adding more nodes to reduce the average number of connections per node, but this is likely a workaround. I think I'll look into Redis as a channel adapter.
The text was updated successfully, but these errors were encountered:
Hi @walkor.
First of all thank you so much for your socket.io port.
I'm getting a lot of errors
Error package. package_length=
and started to investigate it. I found your posts about the client sending the wrong packet. This could be the reason, but I found another case. Im getting errors when worker's clients cross 7-10k connections.To be able to send a message to a specific connection, you defined each "sid" as a room.
https://github.com/walkor/phpsocket.io/blob/master/src/Socket.php#L246
and the adapter will subscribe to the "sid\room"
https://github.com/walkor/phpsocket.io/blob/master/src/ChannelAdapter.php#L33
Each time a client establishes a connection, a message to the channel includes all worker's SIDs
https://github.com/walkor/channel/blob/master/src/Client.php#L199
https://github.com/walkor/channel/blob/master/src/Client.php#L250
similar to this
a:2:{s:4:"type";s:9:"subscribe";s:8:"channels";a:4:{i:0;s:12:"socket.io#/#";i:1;s:37:"socket.io#/#c66cbafbbf80d94105ab5045#";i:2;s:37:"socket.io#/#44dfbbfbbf80d941048015df#";i:3
which will definitely start hitting the packet size limit sooner or later.
Is it make sense for you? just want let people know, who will get same errors that the reason may not be due to wrong packet, but to a simpler reason of growth
This problem can be solved by adding more nodes to reduce the average number of connections per node, but this is likely a workaround. I think I'll look into Redis as a channel adapter.
The text was updated successfully, but these errors were encountered: