prerender/prerender — pull request #111 by rubensayshi (2014-08-26 08:41:33+00:00)
Title: another atempt at getting prerender to be stable without a cron killing it

So I'm still trying to get prerender to be stable without the need of a cronjob (or heroku task) to kill it ...
It has been stable now for ~36 hours, which is a new record (and I got my first night of sleep without pagerduty waking me up for a server that was running hot).
Maybe someone else can give it a shot to see if their issues are also solved ;-)

So I reenabled the 'iterations' config that you guys removed from v1 to v2 (but left in the examples).
It will once again kill the worker thread after the amount of iterations have passed.
when iterations is 0 the killing of phantomjs is disabled, so maybe you could set the iterations config to 0 by default in server.js instead of 10 (which wasn't doing anything right now) so that this feature is also disabled by default...

I also started using SIGKILL to kill the worker, which seems to avoid having phantomjs process stay around.

and preventing the rotating port that's based on the worker.id to rotate above 200 with a modulo.