3 ms·
I've setup Java/Scala projects on 5 USD hosts. Why are they out? With SSD's you could even run a bunch of them thanks to swapfiles.
by merb 11y ago
I've setup Java/Scala projects on 5 USD hosts.
Why are they out? With SSD's you could even run a bunch of them thanks to swapfiles.
- fennecfoxen 11y agoOh, they're out for shared-hosting CGI/FastCGI only, because of high startup time and high memory usage and the fact that no one in Java ever uses that deployment model. If you're doing droplet-based stuff I'm sure it could work, but I don't think the author is satisfied with the costs of running multiple projects.
- brianwawok 11y agoJava / Scala can get dicy on $5 host. Problem 1) SBT cannot run with 512 ram, so you cannot compile locally. If using phat jars, that means you need to upload a 100mb jar every time you want to deploy, vs just a git pull and a build. May or may not matter to you. Problem 2) Once you start doing some actual work, the JVM itself is taking up a few 100 MB of ram, and the OS takes up a fair bit.. this leaves something like 128MB ram for your app best case.. for a lot of apps this is not enough. I had to go up to at least 1 GB VMs to get my medium complexity Scala app to work in prod, and I have been tuning JVMs for many years.
- merb 11y agofallocate -l 4G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile swapon -s Works pretty well. You can't actually run too much on it however if you use a tomcat you actually get a decent Request per Second something like 100r/s. And you don't need 1GB VMs. 512 MB Scala Apps are working fine. It just depends on the technology.