Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We use Google cloud run for this. They bill per request and you can run whatever docker container you want. I currently have a small setup with two separate kotlin based server applications running there (one based on spring boot and one on ktor). We use firestore as a cheap datbase (billed per read & write). Both have a free tier. So it's costing us next to nothing currently because neither docker container is getting a lot of traffic. Basically the bill for last month was only around 2$ for one of these applications (the other one I only deployed a few days ago).

Basically, at some point it gets expensive of course but when you are simply testing out stuff and don't expect a lot of users to show up, it's actually not bad.



how does the kotlin server perform on cloud run? is the startup time slow? does spring take a lot of memeory etc?


I bumped the memory limit from 256MB to 1GB. 2GB is the maximum on cloudrun. You pay a combination of CPU/Memory per request obviously. Beyond that, it scales by firing up more containers as your request load increases to a default maximum of 1000 (we set it at 2).

Obviously don't use this if you have a lot of cpu/memory requirements but otherwise this should be fine for a well crafted stateless server.

Startup is fine with both ktor and spring-boot but obviously takes a bit of time. I noticed there's startup overhead if your container gets shut down because there is no traffic. In that case, it takes around 30 seconds for the first request to go through. That includes everything from booting the container and then starting the process. I imagine simply pinging the server regularly should keep it running. Alternatively, you can configure a minimum amount of servers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: