0

So, I'm using a hypnotoad server for my application and is trying to maintain state for connections. Turns out for every connection a different worker is spawned/selected. Can I somehow make this selection explicit? Also is there a way to know which worker was used for my last request and use it again for corresponding requests?

Apoorv Joshi
  • 389
  • 3
  • 15
  • Are you talking about regular HTTP requests, or Web Sockets? Have you tried issuing HTTP headers for keep-alive connections? – simbabque Aug 03 '17 at 08:52
  • @simbabque I'm talking about regular HTTP requests. The thing is I have an endpoint where another server communicates, over which I don't have any control, that's the reason I can't keep-alive a connection. – Apoorv Joshi Aug 03 '17 at 09:04
  • 1
    Don't, solve your problem a different way. – Sobrique Aug 03 '17 at 10:28

1 Answers1

0

You can ran multiple masters (every with one worker or like morbo - single processes).

And add load balancer before 'em which will be responsible to selection of concrete process per connection.

Typically I used nginx with upstream module sticky setting.

Akzhan Abdulin
  • 993
  • 6
  • 8