On 3/21/07, Gary Doades <[EMAIL PROTECTED]> wrote:
>
> On Mar 21, 9:36 am, "Ed Singleton" <[EMAIL PROTECTED]> wrote:
> > When setting the number of threads in prod.cfg, how do you know how
> > many threads to use?  What are sensible numbers to use?  What happens
> > if you use too many or too few?
> >
> > I've tried googling for this but haven't really found anything.  If
> > anyone can point me in the direction of some good resources I'd be
> > grateful.
> >
> > Thanks
> >
>
> Jorge's reply gives some good guidelines to start with. Only you know
> your application and your server(s) so the calculations will help. You
> also need to be aware that a single cherryPy instance can only use one
> processor for all of its threads even if you have multiple processors
> in a machine. You can get around this by starting multiple instances
> on different ports and put a load balancing proxy in front (lighttpd
> will do nicely). Also get lighttpd or whever your front end is to
> handle the static content directly. This also helps with resilience
> and scalability.
>
> If you have two processors (dual core is now common) you might want to
> start two instances with 10 threads rather than one instance with 20
> threads for example. You'll get much better throughput that way.
>
> Also be aware that SQLAlchemy creates a connection pool rather then
> blindly create a connection per thread. So even if you over estimate
> the number of threads, using SQLAlchemy will not waste your database
> resources. This only applies if you use SQLAlchemy of course!
>
> I know this is not the simple number you were looking for, but
> hopefully it gives you some ideas of where to start and what is
> possible.
>
> Regards,
> Gary.

Thank you Jorge and Gary, both wonderful answers and exactly what I need.

I think this would be a good item for the docs.  If neither of you
minds I think I'll try and use your answers to create something for
the docs.

Ed

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to