Hi Brian,
On 23 Nov 2018, at 21:46, Brian Adkins wrote:
I'm porting a web application from Ruby/Rails to Racket, and I'd like
something to manage the Racket server processes.
In the Ruby world, I'm currently using Unicorn (
https://en.wikipedia.org/wiki/Unicorn_(web_server) ) prior to that I
used
Nginx Passenger ( https://en.wikipedia.org/wiki/Phusion_Passenger ),
etc.
Another popular Ruby app server is Puma
( https://en.wikipedia.org/wiki/Puma_(web_server) )
I'll use nginx as the front end web server, and it will proxy to the
application server. In a nutshell, for Unicorn, I configure the
location of
the Rails app, configure how many processes I want, and Unicorn will
spin
up that number of Rails processes and handle routing requests from
nginx to
each of the Rails processes in some fashion. If a Rails process exists
abnormally, it will spin up another one to replace it. To deploy a new
version of my app, I can send a signal to the Unicorn master process
to
*gracefully* restart all the processes i.e. it waits for the current
request to finish, and then kills the process and spins up a new one
using
the new version of the app.
Are there similar application servers available for Racket?
Alternatively,
if not, and you have long running applications in Racket, what are you
using to manage them?
Just to echo the experience of others here: I've also used the Racket
server straight up on the unfiltered Internet, and had no problems
except (as Greg mentioned) weird requests flowing in that the server
found dubious. Without crashing, I should add; these weird (if not
downright malformed) requests didn't kill the web server, they just
created a lot of junk in the logs. Putting Racket behind a server that's
more prepared to handle such junk (e.g., OpenBSD's httpd) restores log
sanity.
To get back to your real question, though: you want to know how to
deploy a new version of a running web app.
(1) There's the reloadable package
https://pkgs.racket-lang.org/package/reloadable
I myself haven't used it, but it's definitely relevant. That looks like
a real Racket-y solution, which is what I think you're looking for.
(2) I myself view these issues as DevOps-y things to be dealt with not
so much in Racket and more at the OS/service level. Generating an
httpd.conf file and then using OpenBSD's rcctl to switch out the old
config for the new one has been fine for me. This is perhaps a deviant
view; the reloadable package probably reflects a more catholic
understanding of the situation. But there may be cases where you change
your code in ways that are just too big, and I bet you'll find yourself
needing to do something like what I do and what you're currently doing
with Unicorn.
Jesse
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.