As long as each session is handled by the same thread there shouldn't 
be any trouble.

What exactly are you splitting up into threads? From what I've heard 
Python threading isn't really very good. The global interpreter lock 
means only one python thread can run at a time.

You may want to consider just running two Python processes, with some 
kind of component in between to divide up requests between them.

Eg, run a msn1.host and msn2.host, have msn.host do a round-robin 
distribution. So user1 registers with msn.host and is always silently 
redirected to msn1.host

---

James



On 26/08/2005, at 5:41 AM, Gonzalo Barrio wrote:

> This question is for all Py* developers.
> I have the next problem.
> We are using PyMSN / PyAIM / PyICQ and the yahoo transport from xmpppy,
> due to large number of users we decide to use a Dual procesor Machine
> (Dual Pentium Xeon 3.2ghz) expecting that this configuration would be
> sufficient but not.
> Reaching 700 concurrent users the PyMSN use a lot of CPU, I mean 30 - 
> 45
> % (Using select reactor, epoll did not work anytime) but this is not so
> important, in some situations, CPU usage reach 100% by PyMSN and PyMSN
> start being unusable.
> But the worst is that having two cpus (4 seen by top, due to
> hyperthreading), the second procesor was idle, so we have 100% on CPU 1
> and 0 % on CPU 2.
> Debugging we find that twisted is thread safe, and I made an Async
> Method Wrapper (Low level twisted class) So the charge is redistributed
> on all processors.
> The change works fine but the code is ugly. It's a dynamic thread pool.
> I change utility.py and add a file called async_method.py to solve 
> this.
>
> Is there something in PyMSN/PyAIM/PyICQ that I have to consider that
> need to be serial?
>
> Thanks in advance
>
> Gonzalo Barrio
>
> PD: I have a little problem with a method that purge the inactive
> threads, when I have fixed this problem I'm gonna post this to the 
> list.
>
> _______________________________________________
> py-transports mailing list
> py-transports@blathersource.org
> http://www.modevia.com/cgi-bin/mailman/listinfo/py-transports
>

Reply via email to