On Thu, 25 Oct 2018 at 19:01, <brj...@gmail.com> wrote:

> Thank you for the thorough explanation! So if I understand you correctly,
> if no calls are made to the executor thread, it will just rest silently
> until queue-email is called again - not consuming any server resources.
>

That's essentially correct.

Threads do take up a small amount of memory even when idle (IIRC its around
1M per thread), but unless you're dealing with thousands of threads or
you're dealing with very constrained memory, this can be ignored. Creating
a thread is relatively expensive, which is why they're often kept around
for reuse in thread pools.


> Are there any recommendations for the number of worker threads when each
> does IO?
>

It depends entirely on the external service you're communicating with. My
advice would be to choose a relatively small default, say 32 or under, and
then make it configurable from an environment variable or system property.
That way you can tune the service without changing the code.

(def mail-pool-size
  (Integer/parseInt (or (System/getenv "MAIL_POOL_SIZE") "32")))

-- 
James Reeves
booleanknot.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to