google-cloud

Google Cloud Platform: Clojure + {GAE, GCE, anything else on Google Platform}
qqq 2017-01-06T21:32:22.000005Z

@sveri : you're now my favorite person in #gae !

sveri 2017-01-06T21:32:50.000006Z

😄 thanks

notanon 2017-01-06T21:56:57.000008Z

is this #off-topic-v2?

sveri 2017-01-06T22:08:41.000009Z

hehe, not sure

sveri 2017-01-06T22:08:47.000010Z

I am waiting for the rant 😄

notanon 2017-01-06T22:16:32.000013Z

we want a rant!

notanon 2017-01-06T22:16:34.000014Z

we want a rant!

notanon 2017-01-06T22:16:36.000015Z

http://giphy.com/search/dis-gon-b-gud

qqq 2017-01-06T22:20:57.000017Z

@sveri, @notanon: here's the multi part rant: 1) If you want to setup Clojure on GAE via the Java Environment, it's this: http://lambda-startup.com/developing-clojure-on-app-engine/ ^^ this is black magic 2) now, after this is setup, you think to yourself I am awesome. I got clojure on GAE. I am awesome. Why does my app take 20 seconds to load? 3) Maybe this is because assets are served via ring/compojure. Thus, you move everything to public-root/static in app.xml 4) does not fix it 5) then you read about JVM warmstart -- because maybe the delay is due to JVM being started on first request does not fix it 6) then you think -- maybe instead of puny 512MB RAM, JVM/Clojure needs more bigger instances 7) does not fix it 8) then you give up on GAE, because 20 second delay on first reqauest = fucking unacceptable 9) while exploring lein, you discover ":aot :true" one day 10) you try it 11) then you realize ... all this time, lein "uberwar" was uploading *.clj files, NOT compiled java classes. what was happening was as follows: 12) a request comes in: gae fires up a jvm from scratch for you this jvm loads up clojure dependencies this jvm loads up yoru *.clj files this jvm compiles your *.clj files this jvm serves the request ... then if there isn't a immedaite followup request, this jvm is kiled yeah, so that's why there's such shitty latency /end-rant

notanon 2017-01-06T22:21:12.000020Z

now thats what im talking about

qqq 2017-01-06T22:22:02.000021Z

basically, if you're deploying to gae, make sure to use ":aot true" in your project.clj

notanon 2017-01-06T22:22:43.000022Z

how long between requests until the jvm is killed?

notanon 2017-01-06T22:24:50.000023Z

seems pretty unacceptable for a jvm app to be killed like that

notanon 2017-01-06T22:24:59.000024Z

jvm start up is slow 🙂

qqq 2017-01-06T22:27:32.000025Z

ah, you can specify "min # idle instances" and "max # idle instances"

notanon 2017-01-06T22:27:56.000026Z

this rant is turning into a how-to guide 🙂

qqq 2017-01-06T22:28:10.000027Z

yeah, GAE should pay me marketing fees

qqq 2017-01-06T22:28:16.000028Z

the main issue is lack of websocket support

qqq 2017-01-06T22:28:42.000029Z

which I believe can only be done via having a separate google compute engine machine -- whose sole purpose in life is to route websockets

sveri 2017-01-06T22:28:44.000030Z

hm

sveri 2017-01-06T22:28:57.000031Z

does it not work to provide a jar built by uberjar to GAE?

qqq 2017-01-06T22:29:25.000032Z

I know very little about jar/war, but in my very limited understanding, they're using jetty or something, so you're supposed to provide a ring handler of some form

qqq 2017-01-06T22:30:03.000033Z

also, GAE requests only have 30 seconds to respond and very limited system APIs; so even if you uploaded a jar, it'd not be possible to do websockets on GAE with it

qqq 2017-01-06T22:30:20.000034Z

GCE == approcimately EC2, GAE == approximately AWS Lambda

notanon 2017-01-06T22:30:57.000035Z

ec2 is a full unix box that you can do anything with

notanon 2017-01-06T22:31:04.000036Z

you mean gce != ec2?

qqq 2017-01-06T22:31:14.000037Z

gce = google compute engine; gae = google app engine

qqq 2017-01-06T22:31:25.000038Z

gce = gives you a VM, you do whatever you want; gae = you write functions, it runs on their runtime

notanon 2017-01-06T22:31:37.000039Z

ah

qqq 2017-01-06T22:31:45.000040Z

thus, gce == ec2, gae == aws lambda

notanon 2017-01-06T22:31:50.000041Z

wasnt seeing the difference in the acryonms there

notanon 2017-01-06T22:32:16.000042Z

so your whole approach/effort with gae is a no-go?

qqq 2017-01-06T22:32:33.000043Z

I'm very happy with gae; I'm just going to put websockets elsewhere

qqq 2017-01-06T22:32:53.000044Z

I'm now very happy with gae; it was a rough week until all got sorted out