ldnclj

Find us on #clojure-uk
pupeno 2015-09-07T07:29:15.000002Z

Good morning.

thomas 2015-09-07T08:22:28.000003Z

Ma tie

pupeno 2015-09-07T09:32:49.000004Z

I’m doing some performance testing of my Clojure app, and it seems the bare minimum will happily eat 350MB of RAM (Jetty with 6 threads, the minimum). As soon as I add Nashorn, it jumps to >512MB. Is this common or am I experience a problem here? Clojure/Java being memory hungry might have an effect on whether I use Heroku or not.

jonpither 2015-09-07T09:43:54.000005Z

morning

mccraigmccraig 2015-09-07T09:48:49.000006Z

måning

jonpither 2015-09-07T11:53:19.000007Z

hi

jonpither 2015-09-07T11:55:19.000008Z

ola

benedek 2015-09-07T12:21:32.000009Z

u cant do ola jon. or can u? eh... :D

jamiei 2015-09-07T12:42:18.000010Z

Morning

jamiei 2015-09-07T12:42:24.000011Z

Or afternoon now..

jonpither 2015-09-07T14:19:00.000012Z

hola

tcrayford 2015-09-07T15:31:48.000014Z

@pupeno: ime the jvm isn't super fast/happy until it has ~3gb of ram. Not surprised you have issues on Heroku

pupeno 2015-09-07T16:49:41.000015Z

I just published what I think it’s the most comprehensive blog post in how to use New Relic with Clojure: https://carouselapps.com/2015/09/07/using-new-relic-with-clojure/

pupeno 2015-09-07T19:10:31.000017Z

tcrayford: is that personal experience?

tcrayford 2015-09-07T19:25:29.000018Z

yes

tcrayford 2015-09-07T19:25:45.000019Z

I do actually work for Heroku as well though 😉

tcrayford 2015-09-07T19:26:17.000020Z

certainly I've run java apps on Heroku at well under the 512mb limit though

pupeno 2015-09-07T19:29:01.000021Z

For a few more experiments I think I’ll use big heroku instances for now for some experiments but then I’ll move to VPSs.

pupeno 2015-09-07T19:30:35.000022Z

Probably just deploying with capistrano.

tcrayford 2015-09-07T19:31:47.000023Z

I'd uh, recommend using bash or something over capistrano

tcrayford 2015-09-07T19:31:53.000024Z

unless you know cap real well

tcrayford 2015-09-07T19:31:57.000025Z

(it's kinda bad imo)

pupeno 2015-09-07T19:33:07.000026Z

I do know capistrano as I use it already. Using bash would mean having to build a lot of plumbing that capistrano does for me.

tcrayford 2015-09-07T19:34:01.000027Z

fair enough then :simple_smile: It depends how complex your deploys are. Yeller's deploy system doesn't keep around old deploy artifacts or anything like that, just shoves a file in a place and kills the existing process

pupeno 2015-09-07T19:34:43.000028Z

Well, you also need to run it on all the servers, run migrations, etc.

pupeno 2015-09-07T19:35:13.000029Z

I do like having the option to rollback, although I never used it in my life.

pupeno 2015-09-07T19:36:55.000030Z

Also, are people just deploying uberjars that run standalone? No container like Tomcat? I’m new to the Java world so I don’t know if it’s a good idea to just run the uberjar.

tcrayford 2015-09-07T19:37:25.000031Z

clojure standard is uberjar

tcrayford 2015-09-07T19:37:31.000032Z

don't have leiningen on your production machines

tcrayford 2015-09-07T19:37:36.000033Z

just embed jetty or whatever

pupeno 2015-09-07T19:37:54.000034Z

Cool. That’s simple enough.

pupeno 2015-09-07T19:39:10.000035Z

tcrayford: thanks for pointing it about 3GB of ram. I’m running with 1GB and I can’t go above 0.9 hits per second.

tcrayford 2015-09-07T19:39:45.000036Z

😮

pupeno 2015-09-07T19:40:16.000037Z

I mean, on average.

tcrayford 2015-09-07T19:40:34.000038Z

yeah that's still very slow

tcrayford 2015-09-07T19:41:09.000039Z

I'd expect the average clojure/jetty app to hit ~10k requests/s if it's completely unperformance tuned and not doing too much weirdness with the db

tcrayford 2015-09-07T19:41:24.000040Z

maybe more like 70k-100k if it's still http and tuned somewhat

pupeno 2015-09-07T19:41:24.000041Z

http://i.imgur.com/PywDKgi.png

pupeno 2015-09-07T19:42:10.000043Z

I’m going to try again with up to 20 virtual concurrent users.

pupeno 2015-09-07T19:42:40.000044Z

But I do have Jetty limited to 10 threads, trying to stay within the RAM constraints.

pupeno 2015-09-07T19:42:58.000045Z

Responses are fast though, 78ms.

pupeno 2015-09-07T19:43:46.000046Z

It seems the JavaScript implementation, Nashorn, is very memory hungry.

tcrayford 2015-09-07T19:44:02.000047Z

oh, you're hitting js on each request? that's likely the problem imo

pupeno 2015-09-07T19:44:30.000048Z

tcrayford: this is what I’m testing.

pupeno 2015-09-07T19:48:55.000049Z

I will think of ways to not execute JS when it’s not really needed, but first, I want to understand the performance of it.