TLDR: Burned by framework magic. Talk about side effects. Ten layers (and probably buffers) traveled through until your data hits the wire. Layer x decides to change its IO model and your throughput takes a dive. It's exactly why there was a post recently about building an operating system just to run some network daemon.
Reaching 200K events/sec
21–29 of 29 posts
Re: Reaching 200K events/sec
#22 (defn execution-handler
"Creates a new netty execution handler."
[]
(ExecutionHandler.
(OrderedMemoryAwareThreadPoolExecutor.
16 ; Core pool size
1048576 ; 1MB per channel queued
10485760 ; 10MB total queued
)))
It is a farce, isn't it?))Re: Reaching 200K events/sec
#23(defn execution-handler "Creates a new netty execution handler." [] (ExecutionHandler. (OrderedMemoryAwareThreadPoolExecutor. 16 ; Core pool size 1048576 ; 1MB per channel queued 10485760 ; 10MB total queued ))) It is a farce, isn't it?))
After finally digging into how execution handlers worked, the puzzle started to unravel. Netty's docs are pretty good, but you have to understand what all the names mean before you can understand, well, any one part of the system. Bit tough to piece together, at least for my little brain. ;-)
Re: Reaching 200K events/sec
#24Earlier quoted context omitted.
You are likely doing something wrong. My in-memory redis server clone that also uses netty reaches 1.5M requests/s on an arguably heavier workload with a more complicated protocol. I'd love to help you optimize it if it matters.
Thanks for the offer! I, uh, certainly didn't mean to claim that Riemann is extraordinarily fast. Up until this point I've been working as hard as I can just to make the darn thing turn on and accomplish something useful. This is quite early in the optimization process, haha. :) The principle bottleneck in this particular test is actually the client--Riemann itself spends ~94% of its time waiting on epoll in this tes…
Re: Reaching 200K events/sec
#25(defn execution-handler "Creates a new netty execution handler." [] (ExecutionHandler. (OrderedMemoryAwareThreadPoolExecutor. 16 ; Core pool size 1048576 ; 1MB per channel queued 10485760 ; 10MB total queued ))) It is a farce, isn't it?))
Heh, I originally cargo-culted this line from somewhere in Netty's docs: https://github.com/aphyr/riemann/blob/732a6e8986f75c638c30b5... After finally digging into how execution handlers worked, the puzzle started to unravel. Netty's docs are pretty good, but you have to understand what all the names mean before you can understand, well, any one part of the system. Bit tough to piece together, at least for my little…
I'm also not sure that JVM itself is a good idea, especially for serving content, but I do respect people who are trying nevertheless.)
Re: Reaching 200K events/sec
#26If you're wondering about the workload, this is the trivial Riemann config this benchmark uses: (streams (rate 5 (comp prn float :metric)) Which means for each five-second interval, sum all the metrics of the events flowing through this stream, divide by the time elapsed, and print that rate to the console. I'm using this setup to put the heaviest load possible on Riemann's client and TCP server while I optimize thos…
You are likely doing something wrong. My in-memory redis server clone that also uses netty reaches 1.5M requests/s on an arguably heavier workload with a more complicated protocol. I'd love to help you optimize it if it matters.
1.5M locally or over a network? What is the size of each message?
Re: Reaching 200K events/sec
#27Earlier quoted context omitted.
You are likely doing something wrong. My in-memory redis server clone that also uses netty reaches 1.5M requests/s on an arguably heavier workload with a more complicated protocol. I'd love to help you optimize it if it matters.
Is the source available anywhere? 1.5M locally or over a network? What is the size of each message?
The test was run with "SET key value" which in the redis protocol is something like 15-20 bytes / message.
Re: Reaching 200K events/sec
#28Earlier quoted context omitted.
You are likely doing something wrong. My in-memory redis server clone that also uses netty reaches 1.5M requests/s on an arguably heavier workload with a more complicated protocol. I'd love to help you optimize it if it matters.
Thanks for the offer! I, uh, certainly didn't mean to claim that Riemann is extraordinarily fast. Up until this point I've been working as hard as I can just to make the darn thing turn on and accomplish something useful. This is quite early in the optimization process, haha. :) The principle bottleneck in this particular test is actually the client--Riemann itself spends ~94% of its time waiting on epoll in this tes…
Re: Reaching 200K events/sec
#29Earlier quoted context omitted.
Heh, I originally cargo-culted this line from somewhere in Netty's docs: https://github.com/aphyr/riemann/blob/732a6e8986f75c638c30b5... After finally digging into how execution handlers worked, the puzzle started to unravel. Netty's docs are pretty good, but you have to understand what all the names mean before you can understand, well, any one part of the system. Bit tough to piece together, at least for my little…
All I'm trying to say is that switching to the prefix notation adding parenthesis does not make Java a Lisp. ;-) I'm also not sure that JVM itself is a good idea, especially for serving content, but I do respect people who are trying nevertheless.)
(defn where-partition-clauses
"Given expressions like (a (else b) c (else d)), returns [[a c] [b d]]"
[exprs]
(map vec
((juxt remove
(comp (partial mapcat rest) filter))
(fn [expr]
(when (list? expr)
(= 'else (first expr))))
exprs)))
I wouldn't categorize Clojure as a "pure lisp"--it relies heavily on the JVM type system, for starters--but idiomatic Clojure feels closer to Lisp than Java, to me.