I think it's better to support it with separate processes. That way you 
get scalability to multiple machines for free :)

My general idea for clustering only provides load balancing. It doesn't 
improve reliability at all.

All users register with the "supergateway" msn.host.com. That is the 
only JID they ever see associated with PyMSNt.
You run several copies of PyMSNt with JIDs msn1.host.com, 
msn2.host.com, etc.
The first time msn.host.com receives a registration request for a user 
it picks a host to send it to, based on the load of that host. It then 
makes sure that all subsequent stanzas for that user are sent to that 
PyMSNt instance.

So a typical message would look like this.
<message from="[EMAIL PROTECTED]" 
to="[EMAIL PROTECTED]">
<body>hi friend</body>
</message>

supergateway forwards:
<message from="[EMAIL PROTECTED]" 
to="[EMAIL PROTECTED]">
<body>hi friend</body>
</message>

PyMSNt instance receives a response from the MSN side.
<message from="[EMAIL PROTECTED]" 
to="[EMAIL PROTECTED]">
<body>hi to you too</body>
</message>

supergateway forwards back to the user
<message from="[EMAIL PROTECTED]" 
to="[EMAIL PROTECTED]">
<body>hi to you too</body>
</message>


Another idea would be to implement your own router and have the PyMSNt 
instances connect to that, with your router connecting to the main 
Jabberd router. Then you wouldn't have to fudge the from/to addresses 
so much :)

Those are just musings, so feel free to do whatever with them.

---

James



On 30/08/2005, at 4:24 AM, Gonzalo Barrio wrote:

> I split all the reactor callbacks into a spool of threads running that
> callbacks. I modify the utility.py the class callbacklist.
> Well, I don't want to run python under erlang. And I think that
> clustering is a real good answer for this, but clustering for all kind
> of server (jabberd1,jabberd2, ejabberd, jive, etc...). If a have to 
> make
> a component between server and a pool of PyMSN process I gonna make it.
> What you think that is better, support clustering using another process
> or inside PyMSN ?
> What about using resource part of the jid ?
>
> Thanks in advance,
>
> Gonzalo Barrio.
>
> Sander Devrieze wrote:
>
>> Op zaterdag 27 augustus 2005 04:42, schreef James Bunton:
>>
>>
>>> 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
>>>
>>>
>>
>> Or make it really clusterable: for this you need to make sure that the
>> database (accounts etc) is duplicated in all nodes runing PyMSNt. The 
>> Jabber
>> server then needs to do the round-robin for the transport. In 
>> ejabberd this
>> should be already possible: just add entries for each PyMSNt node in
>> ejabberd's config file (this is what Alexey said me in the past).
>>
>> Could be useful:
>> http://starship.python.net/crew/gandalf/PyErlang/
>>
>>
>>
>
>
> _______________________________________________
> py-transports mailing list
> py-transports@blathersource.org
> http://www.modevia.com/cgi-bin/mailman/listinfo/py-transports
>

Reply via email to