Excessive stop/start hypnotoad workers

142 views
Skip to first unread message

Mikhail

unread,
Feb 6, 2018, 12:52:54 AM2/6/18
to Mojolicious
$ mojo version
CORE
  Perl        (v5.26.1, linux)
  Mojolicious (7.61, Doughnut)

OPTIONAL
  EV 4.0+                 (4.22)
  IO::Socket::Socks 0.64+ (n/a)
  IO::Socket::SSL 1.94+   (2.052)
  Net::DNS::Native 0.15+  (n/a)
  Role::Tiny 2.000001+    (2.000006)

Hi!

I have a trouble with Mojolicious project serves by hypnotoad. My problem occur on requesting heavy SQL data.

I had increase $c->inactivity_timeout(600) in some controller action.

At the log I see that the workers go down on that actions/requests:

Fr 2 Feb 09:52:31 [d] Mojolicious:131 POST "/some/report/data"
Fr 2 Feb 09:52:31 [d] Mojolicious::Routes:162 Routing to controller "Controll::Some::Report" and action "data"
Fr 2 Feb 09:53:03 [i] Mojo::Server::Prefork:128 Stopping worker 1526 gracefully (120 seconds)
Fr 2 Feb 09:53:03 [i] Mojo::Server::Prefork:162 Worker 726 started
Fr 2 Feb 09:53:10 [d] Mojolicious::Controller:211 200 OK (38.658608s, 0.026/s)
Fr 2 Feb 09:53:10 [i] Mojo::Server::Prefork:173 Worker 1526 stopped


On each request workers go down and new one start. Browser get data successfully.
 

Another requests to other fast time actions has normal behavior - without stopping workers.


This is not very big problem but little bit miss proper.




Илья Рассадин

unread,
Feb 6, 2018, 10:10:06 AM2/6/18
to Mojolicious
Looks like this is behaviour of a gracefull_timeout attribute of Mojo::Server::Hypnotoad
From the docs https://metacpan.org/pod/Mojo::Server::Hypnotoad#graceful_timeout

Maximum amount of time in seconds stopping a worker gracefully may take before being forced, defaults to the value of "graceful_timeout" in Mojo::Server::Prefork. Note that this value should usually be a little larger than the maximum amount of time you expect any one request to take.


So you need to set graceful_timeout, not only inactivity_timeout to achieve desired behaviour.


вторник, 6 февраля 2018 г., 8:52:54 UTC+3 пользователь Mikhail написал:

Mikhail

unread,
Feb 6, 2018, 11:02:37 PM2/6/18
to Mojolicious
спасибо, но there is no default helper for gracefull_timeout at that there is inactivity_timeout helper, поэтому получаются грабли у первопроходцев. Ведь всего лишь нужно изменить поведение на одном действии в контроллере.

How to change gracefull_timeout inside controller action only?

sri

unread,
Feb 7, 2018, 2:47:40 PM2/7/18
to Mojolicious
спасибо, но there is no default helper for gracefull_timeout at that there is inactivity_timeout helper, поэтому получаются грабли у первопроходцев. Ведь всего лишь нужно изменить поведение на одном действии в контроллере.

Please speak english on this list.
 
How to change gracefull_timeout inside controller action only?

That makes no sense, you're misunderstanding something.

--
sebastian 

Mikhail

unread,
Feb 7, 2018, 11:24:31 PM2/7/18
to Mojolicious


That makes no sense, you're misunderstanding something.

--
sebastian 

okay, my misunderstood in that how to stand steady workers (avoid harakiri) when I increase inactivity_timeout action only.
Reply all
Reply to author
Forward
0 new messages