Hypnotoad forks and nginx reverse proxy

123 views
Skip to first unread message

Bakanov Dmitriy

unread,
Mar 19, 2015, 3:46:44 AM3/19/15
to mojol...@googlegroups.com
Hello,

I'm currently using hypnotoad and nginx reverse proxy. I want to use 4 hypnotoad workers. I would like to understand, will nginx use random workers (and random IOLoops) each time? Is it possible to run hypnotoad workers with different ports to make nginx server management more explicit?
Currently I have issue with IOLoop timer in my mojolicious app. I have no this problem, when I use only one worker, or when I use direct connection to hypnotoad without nginx proxy. I think it's because nginx uses random worker (and random IOLoop) to send message, but when I have direct connection worker is not random, so is here anyone who is using hypnotoad with multiple workers and nginx and who knows how to make nginx communication with Hypnotoad workers less random and more explicit? Or, probably mojolicious developers can explain it.

Thanks,
Dmitry

Dan Book

unread,
Mar 19, 2015, 1:25:57 PM3/19/15
to mojol...@googlegroups.com
The idea is that hypnotoad will manage its workers, so yes, you cannot rely on which worker will handle a given connection. Each worker should run their own IOLoop and thus their own timers. If you describe the issue more precisely maybe we can help further.

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious...@googlegroups.com.
To post to this group, send email to mojol...@googlegroups.com.
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Bakanov Dmitriy

unread,
Mar 20, 2015, 2:23:31 AM3/20/15
to mojol...@googlegroups.com
The problem is: I need to do some stuff (write to database, log etc.) after some timeout after last message from some client. I'm using timeout to determine that client stopped answering, and after it I need to log that client stopped answering. To do it I need to have some sort of timer. And this timer must work no matter how many workers I have. And timeout must happen no matter what worker receive messages from client.
By the way, I develop a web service with mojolicious. I want to find out what mojolicious techniques I can use to create such timer. Or I need to use not mojolicious techniques.

P.S. And also it's desirable to have such timer with Starman server, not only Hypnotoad. 

Thanks,
Dmitry


четверг, 19 марта 2015 г., 22:25:57 UTC+5 пользователь Dan Book написал:
Reply all
Reply to author
Forward
0 new messages