Joseki-jl/Joseki.jl

Startup time

Opened this issue · 8 comments

We need to figure out how to reduce it by default, or have clear instructions about how the end user can minimize it. This was an issue that @markhalonen ran into with https://github.com/markhalonen/sauna-sim.

Just for the record, it wasn't the Joseki package that gave me issues, but rather a the SaunaModel.jl package (by @bhalonen), which uses DifferentialEquations.

I could get a basic Joseki server running on Heroku without any issues.

I could get a basic Joseki server running on Heroku without any issues.

I think I misremembered this, as I'm now getting this error with deploying the example app to Heroku:

2019-04-22T22:34:47.699701+00:00 heroku[web.1]: Starting process with command `/bin/sh -c JULIA_DEPOT_PATH\=/opt/julia-1.0/.julia\ julia\ -e\ \'using\ Pkg\;\ pkg\"activate\ .\"\;\ include\(\"examples/docker-simple.jl\"\)\'`
2019-04-22T22:35:22.129512+00:00 heroku[web.1]: Process running mem=912M(178.2%)
2019-04-22T22:35:22.129564+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2019-04-22T22:35:31.586767+00:00 heroku[web.1]: Process running mem=1279M(250.0%)
2019-04-22T22:35:31.586866+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2019-04-22T22:35:31.586949+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-04-22T22:35:31.730115+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-22T22:35:31.724020+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-22T22:35:31.708478+00:00 heroku[web.1]: Process exited with status 137
2019-04-22T22:35:40.577225+00:00 heroku[web.1]: Starting process with command `/bin/sh -c JULIA_DEPOT_PATH\=/opt/julia-1.0/.julia\ julia\ -e\ \'using\ Pkg\;\ pkg\"activate\ .\"\;\ include\(\"examples/docker-simple.jl\"\)\'`
2019-04-22T22:36:07.334667+00:00 heroku[web.1]: Process running mem=1279M(250.0%)
2019-04-22T22:36:07.334778+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2019-04-22T22:36:07.334877+00:00 heroku[web.1]: Stopping process with SIGKILL
2019-04-22T22:36:07.477531+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-22T22:36:07.459363+00:00 heroku[web.1]: Process exited with status 137

This was the same error that forced me to ec2 for saunasim.

I think in general it would be awesome to be able to deploy Julia APIs to Heroku, it really is a lot nicer than using AWS, especially for toy projects like mine.

Huh, I'll need to take a look at that -- I'm not sure why that would use so much memory. I remember that Chris and I needed to do some stuff to get DiffEq to startup in a reasonable amount of time.

This can probably be fixed by using (or using the approach from) https://github.com/Optomatica/heroku-buildpack-julia

yeah, I'm at JuliaCon too! It's working in ec2 but costs $50/month so I might look into that

I didn't make it this year, but I'm trying to catch some of the talks. Are you using Fargate by any chance? That might be a good way to reduce the cost somewhat if you want to stay on AWS.

Here's a working Joseki buildpack example. Seems to have helped with startup time. First calls to functions are still sluggish, but that's easy to fix with a wakeup call. Feel free to incorporate any of the content into your instructions.