Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incredible big session #421

Closed
toomus opened this issue Feb 3, 2016 · 6 comments
Closed

Incredible big session #421

toomus opened this issue Feb 3, 2016 · 6 comments

Comments

@toomus
Copy link

toomus commented Feb 3, 2016

Hi. I have some weird problem in my Rails app. After this messages:

**** INCOMING ****
{"channel"=>"/meta/connect", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "connectionType"=>"websocket", "id"=>"5", "ext"=>{"user_id"=>215, "realtime_events_token"=>"ef32a222-0e58-41da-8b59-b7b49bbfdb64"}}

**** OUTGOING ****
{"id"=>"5", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "channel"=>"/meta/connect", "successful"=>true, "advice"=>{"reconnect"=>"retry", "interval"=>0, "timeout"=>25000}}

session size is ~50MB. When I disable faye in browser, session size is ~50KB. Is this normal? And why client connects so many times?

**** OUTGOING ****
{"id"=>"d", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "channel"=>"/meta/connect", "successful"=>true, "advice"=>{"reconnect"=>"retry", "interval"=>0, "timeout"=>25000}}

**** INCOMING ****
{"channel"=>"/meta/connect", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "connectionType"=>"websocket", "id"=>"e", "ext"=>{"user_id"=>215, "realtime_events_token"=>"ef32a222-0e58-41da-8b59-b7b49bbfdb64"}}

**** OUTGOING ****
{"id"=>"e", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "channel"=>"/meta/connect", "successful"=>true, "advice"=>{"reconnect"=>"retry", "interval"=>0, "timeout"=>25000}}

**** INCOMING ****
{"channel"=>"/meta/connect", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "connectionType"=>"websocket", "id"=>"f", "ext"=>{"user_id"=>215, "realtime_events_token"=>"ef32a222-0e58-41da-8b59-b7b49bbfdb64"}}

**** OUTGOING ****
{"id"=>"f", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "channel"=>"/meta/connect", "successful"=>true, "advice"=>{"reconnect"=>"retry", "interval"=>0, "timeout"=>25000}}

**** INCOMING ****
{"channel"=>"/meta/connect", "clientId"=>"ahhhyccl5tra4cv5g1kp76oawqw0zvu", "connectionType"=>"websocket", "id"=>"f", "ext"=>{"user_id"=>215, "realtime_events_token"=>"ef32a222-0e58-41da-8b59-b7b49bbfdb64"}}
@jcoglan
Copy link
Collaborator

jcoglan commented Feb 6, 2016

I've never heard anyone experience this problem. Faye itself does not interact with cookies or the session in any way; all of Faye's interaction with the Rack environment is contained in the RackAdapter class if you want to inspect what's going on.

The presence of ext fields indicates you're running some extensions but I'm not sure what they are. Those might have access to the Rack environment and could be responsible.

Failing that, I'd need you to put together a test case consisting of a small Rails app containing just enough code to reproduce this problem.

@jcoglan
Copy link
Collaborator

jcoglan commented Feb 6, 2016

The repeated /meta/connect messages are normal. They are not the client 'connecting' as such, only a single WebSocket connection will be being used. Those messages are the part of the Bayeux protocol that's used to poll for new messages. When using a persistent connection transport like WebSocket (as opposed to long-polling), new messages are pushed immediately and the /meta/connect messages are just used as a keep-alive mechanism to prolong the client's Bayeux session.

@toomus
Copy link
Author

toomus commented Feb 8, 2016

@jcoglan Thx for reply :) I forgot to say, that I'm not using pure faye gem, but faye-rails because it adds some useful features. So maybe the problem is this gem? I found issue in Devise repo, where someone has the same problem. What you think about that?

@jcoglan
Copy link
Collaborator

jcoglan commented Feb 11, 2016

Honestly, I don't know enough about faye-rails or Devise to comment. It's entirely possible that one of those libraries causes an interaction between Faye and the session but I wouldn't know.

@toomus
Copy link
Author

toomus commented Mar 15, 2016

@jcoglan thanks for reply. The cause of all my problems described above was "web-console" gem, which is built in into Rails. Finally the application works fast :)

@jcoglan
Copy link
Collaborator

jcoglan commented May 1, 2016

I'm going to close this since it sounds like you found the source of the problem, but please re-open if you have more questions :)

@jcoglan jcoglan closed this as completed May 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants