Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8748255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:29:37+00:00 2026-06-13T12:29:37+00:00

I’m currently trying to scale gevent-socketio across multiple workers with the gunicorn server using

  • 0

I’m currently trying to scale gevent-socketio across multiple workers with the gunicorn server using the worker socketio.sgunicorn.GeventSocketIOWorker. I’m using websockets when it exists otherwise I’m forcing XHR-polling (for IE etc).

XHR-polling needs a session to keep track of the following polls but as soon as I go from one to two or more workers the requests starts spreading out between themselves which means the state is lost and everything breaks down.

I think the following lines of code is relevant:
https://github.com/abourget/gevent-socketio/blob/master/socketio/handler.py#L104-106
I suppose I need some other storage engine, for example redis which I’m using for regular pubsub-actions but this is deep inside the actual library.

So my question is how do I go from in-memory session storage to another backend engine globally in my application (does it gracefully override the session code in the link above?) without having to modify the library itself? Something like PHP’s session directives in php.ini. I suppose an argument could be made that this is a very generic python question but I’m having trouble to find relevant information, and I’m also unsure that it’ll work for this library.

Or in the alternative, how do I use gevent-socketio’s xhr-polling transport across different workers and servers (without stickyness)?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:29:38+00:00Added an answer on June 13, 2026 at 12:29 pm

    This is obviously a limitation of socketio. From what I can see on the web, session handling is typically done at web framework layer rather than web server one. socketio tries to do it on its own, lower layer, and does it in a limited manner. I guess the authors thought a full-fledged solution would be an overkill. In your case, they proved to be wrong.

    There are only two ways to overcome limitations that require logic change: patching the source and patching in the runtime. Choose whichever pleases you the most (or, well, disgusts the least :^) ). For the 2nd option, I suggest to replace request_tokens and/or the code that creates it with another entity with the same interface. Due to the reasons stated in the 1st paragraph, I really think that socketio authors are likely to accept a source patch that would allow it to utilize external session handling mechanisms if you propose one.

    Standard locations for session information are: shared memory, files, database. I suggest you change the logic in such a way that socketio uses the same mechanism as your web framework (or whatever composes your pages) does.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.