Re: Question:Multi-Core processor affinity for load balancing Clojure Web apps

2011-11-06 Thread Gary Trakhman
it seems like the only difference would be 4 garbage collectors working on 
smaller heaps, however there would be much  more memory overhead that way. 
 I assume if you can load-balance your app like that, that it is stateless, 
and won't use a whole bunch of static memory.  You might do better with 
changing some performance tuning parameters.  This is a great video that 
describes the tradeoffs: http://www.parleys.com/#id=2662st=5

-- 
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

Question:Multi-Core processor affinity for load balancing Clojure Web apps

2011-10-20 Thread Tim Robinson
This may not be a Clojure specific kind of question, but this is for
my Clojure web app(s) so hopefully it's not too far off.

Currently when I deploy my web apps I run 1 app instance on 1 app
server. Given these are multi-core servers I am thinking about running
4 app instances on a server to get max IO capabilities at a lower
cost.  (Note that I currently using nginx, to route requests to a
Clojure/Ring+Jetty web app on a specified port. I am expecting that in
order to run 4 app instances I will need to load balance within nginx
to each port and also set the processor affinity for each app instance
to ensure they are balanced across cores).

So here are my questions:

1. Does this idea make sense? why/whynot?
2. Do you do currently do this for your web apps and can you provide
any insight/experiences that could be helpful?
3. Is there a way to specify processor affinity within the
application, such that I wouldn't need to manually set them
afterwards?
4. Are there better ideas to accomplish the same kind of thing?

Thanks for any help/ideas.

Tim



-- 
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


Re: Question:Multi-Core processor affinity for load balancing Clojure Web apps

2011-10-20 Thread Colin Yates
I don't think so.  Jetty is also multi-threaded; each request will be served
by a new thread (within a bounded thread pool).  Secondly, processor
affinity is almost always a bad idea; the OS is pretty good at doing this
for you.

At the very least I would have a test harness which measures the behaviour
of the application under heavy concurrent access - I would be amazed if you
any benefit from your approach.  I wouldn't be surprised at all if it
becomes much worse - sorry :).

Note; I am not a performance specialist and even if I claimed to be one you
should always take advice with a pinch of salt.  It should be fairly easy to
measure the difference between the two deployment models yourself.

Sorry.

On 20 October 2011 19:41, Tim Robinson tim.blacks...@gmail.com wrote:

 This may not be a Clojure specific kind of question, but this is for
 my Clojure web app(s) so hopefully it's not too far off.

 Currently when I deploy my web apps I run 1 app instance on 1 app
 server. Given these are multi-core servers I am thinking about running
 4 app instances on a server to get max IO capabilities at a lower
 cost.  (Note that I currently using nginx, to route requests to a
 Clojure/Ring+Jetty web app on a specified port. I am expecting that in
 order to run 4 app instances I will need to load balance within nginx
 to each port and also set the processor affinity for each app instance
 to ensure they are balanced across cores).

 So here are my questions:

 1. Does this idea make sense? why/whynot?
 2. Do you do currently do this for your web apps and can you provide
 any insight/experiences that could be helpful?
 3. Is there a way to specify processor affinity within the
 application, such that I wouldn't need to manually set them
 afterwards?
 4. Are there better ideas to accomplish the same kind of thing?

 Thanks for any help/ideas.

 Tim



 --
 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 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