3 ms·
I want to slap a bunch of side projects on a small VPS. With Go, this is no problem. Scp the binary (which includes an embedded SQLite), configure it to run as
by christophilus 5y ago
I want to slap a bunch of side projects on a small VPS. With Go, this is no problem. Scp the binary (which includes an embedded SQLite), configure it to run as a systemd service, add it to my reverse proxy rules.
I’d love to use Clojure for this, but it doesn’t seem well suited to running in a small, shared environment. Or is it now that there’s AOT?
- lf-non 5y agoPerhaps fennel+openresty is a better fit for that kind of use case.
- melony 5y agoDepends on how much value you place on performance. For long running processes like web servers, the JVM still reigns supreme.
- stingraycharles 5y agoYou should be fine, but it depends on your definition of “small VPS”. Generally, assume that each process will need about 512MB of memory. You’ll definitely want to restrict the JVM by memory, either by explicit flags (-Xmx ) or by running them in a cgroup or container.
- lvh 5y agoPretty similar with Clojure, though because it's not the default mode of operation, more stuff will break. Still, we do this all the time and it's mostly fine. That said, seems like you should be able to do something pretty similar fairly easily with jars and the JVM (you may not want to run lots of JVMs in the method you're describing, since if you're calling these processes in a one-shot, CGI-style fashion, the JVMs startup time and memory requirements is going to be annoying.) GP also linked babashka which may be closer to your interests, as its an interpreter for small scripts like these, but also comes with a mechanism (pods) for loading dependencies (like SQLite).
- nathell 5y agoI'm running a side project in Clojure (a guess-the-number-of-covid-cases lottery, https://koronalotek.pl https://koronalotek.pl) on a small VPS (Scaleway DEV1-S), and it is no problem either. It runs happily in the 2 GB RAM that the server has; I just installed the JVM, configured a nginx reverse proxy, and am using the standard cli-tools in a screen session to run it.
- naruhodo 5y agoHere, have some PCP![1] The first one's free! > An easy to use, drop-in Clojure replacement for php scripts > Allow multiple websites to be hosted on a single $5 VPS > The utility is a simple binary, built with GraalVM, that allows you to work effectively with pcp. Note that not all of PCP is AOT compiled. Just the command line utility. There's a daemon as well. [1] <https://github.com/alekcz/pcp https://github.com/alekcz/pcp>