This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-11
Channels
- # admin-announcements (71)
- # beginners (8)
- # boot (109)
- # cbus (5)
- # cider (27)
- # cljsrn (77)
- # clojure (65)
- # clojure-austin (5)
- # clojure-berlin (1)
- # clojure-brasil (1)
- # clojure-dev (58)
- # clojure-japan (15)
- # clojure-russia (193)
- # clojure-seattle (3)
- # clojurescript (120)
- # cursive (19)
- # data-science (1)
- # datomic (10)
- # docs (1)
- # editors-rus (17)
- # emacs (2)
- # events (1)
- # funcool (7)
- # hoplon (2)
- # jobs (1)
- # jobs-rus (16)
- # ldnclj (7)
- # leiningen (3)
- # off-topic (12)
- # om (450)
- # onyx (122)
- # re-frame (69)
- # reagent (28)
- # yada (20)
Is that because the anonymous instances implement it explicitly? Unless I’m blind, AFn only implements IFn, and IFn doesn’t extend IMeta
(one small gotcha with attaching metadata to functions is that you won't be able to return primitives anymore)
how would you flatten a list of lists being produced by a transducer as a part of the transformation process?
your code needs more cats anyways
this explains so much
is there a combinator in Specter that can collect the path visited by walker
? E.g. (select [(collect-walker symbol?)] {:x {:y 'a}})
-> ([:x :y 'a])
My web app seems to be leaking threads. I see that the thread count climb from 100 to 4000 steadily over the past month, which (I think) caused my system to crash. Can anyone recommend a profiler that will make hunting this down easy? I am looking at jconsole, visualvm, and yourkit, but I haven’t used any of them...
yourkit is the best IMO, but it costs money. JVisualVM is a newer version of JConsole, so that's what I use mostly.
max, how do you manage threads in your application? or is it only the web server threads ? jconsole will help you.
bcambel: I’m using http-kit for the webserver, I also use carmine to do some backround tasks backed by a redis queue, and have some jobs happen periodically using quartzite. I’m not sure what’s leaking threads (though I suspect its a web endpoint).
I would highly suggest you to use something like https://github.com/TheClimateCorporation/claypoole I don't think http-kit will be the problem but who knows.
also one way to figure out is to separate background tasks from the main process, and see if threads are growing still
is it possible to do a flight recording off production to analyze offline without restarting the app?
part of the problem is I haven’t been able to reproduce the issue locally as well as I’d like.
@max Do you see where they are stuck and why they do not terminate? "kill -QUIT <pid>" might give you an idea.
@max: is it jdk8, and can you set up X forwarding? if so then flight recorder should work
@pbostrom: damn it the server is java version "1.7.0_79" OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1) OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
bcambel: are you suggesting splitting other aspects of the application into separate apps/processes?
fair enough. I am pro-microservices, although I am not sure how clojure people do it. If I have 12 diff processes do I spin up 12 JVMs for it?
Yeah. The goal is to get there, but as you know it often makes sense to start with a monolith when you’re trying to figure out what you’re building
sure I understand the simplicity aspect of it, but you got the first signal, so better to warm up your hands. It's not that hard to manage 2 processes. ( I am also big fan of Supervisor )
I also need to implement very soon background jobs for http://github.com/bcambel/hackersome
bcambel: definetly. I would like to learn more about best practices for clojure web stacks. Even deciding whether to use a servlet container or not was difficult. And I will have to re-evaluate that as I split up the monolith.
it is always difficult . For example Puppetlabs has these kind of base services. checkout https://github.com/puppetlabs/trapperkeeper
@max, kill -3 PID
and looking at the thread dump should tell you whose threads are hanging. Most of the libraries name their thread, e.g. nrepl-worker-...
, http-...
. Splitting the app just because you have one problem is a bit too extreme.