airbnb / hypernova

A service for server-side rendering your JavaScript views
MIT License
5.82k stars 208 forks source link

Open to adding the ability to restart workers #97

Open Will-Sommers opened 6 years ago

Will-Sommers commented 6 years ago

Hi y'all!

First off, thank you for a really great Github project. We use it here at RTR and its added a lot of rigor around the server-side rendering from our Ruby app.

Onto the issue. Would you be open to a PR which allows the hypernova master process to restart its workers after a specific number of requests. We currently have a job calling SIGTERM on the workers due to memory leaks resulting from our not using createGetComponent.

We have a lot of top level modules and so we opted to not go that route for now and are wondering what your opinion would be on allowing for a hybrid approach, similar to what unicorn-worker-killer does for Ruby.

Thanks again!

ljharb commented 6 years ago

That does seem reasonable to me; although it masks the real problem, it would prevent production problems while it's investigated.

Will-Sommers commented 6 years ago

Cool! One of the things we noticed about running without createGetComponent is that its really helpful for local development because the restarts are really fast. I'm not sure how y'all load components in without restarting the server — perhaps I'm totally missing something.

ljharb commented 6 years ago

@goatslacker, what are your thoughts?

Will-Sommers commented 6 years ago

@ljharb & @goatslacker, I'm going to start off with a PR or perhaps just a hook to be able to send a worker an exit message and will go from there.

jamesmosier commented 5 years ago

Hey @Will-Sommers. Were you able to make any progress on this? Or care to share a bit about your current setup? Thanks!