[Twisted-web] Multithread SSL
radix at twistedmatrix.com
Wed Jun 24 16:05:16 EDT 2009
On Wed, Jun 24, 2009 at 4:00 PM, lasizoillo<lasizoillo at gmail.com> wrote:
> 2009/6/24 Yann Pomarede <yann.pomarede_twisted at gadz.org>:
>> Thanks for your reply.
>> I already thought about that but I'll have other problems if I do so:
>> - I need some variables to be common between the instances (Maybe it's
>> not so difficult with RPC or a DB or shared memory).
> If you need full ACI (ACID without durability) this can be a performance issue.
>> - I also need to keep a pool of all the outgoing the connections (to
>> perform some real time stats and to limit the number of connection per
> The load balancer can limit number of connections (without decipher
> ssl) or agregate real time stats from web servers (for easier
> management). You can upgrade code in your web app without lost service
> too ;-)
>> But if I do not have other choices, it's certainly what I'll have to do...
> Threads are not the solution. Python have a GIL (Global Inter-Lock)
>  and don't use multicore facilities. I don't know if you can do
> multiprocessing with twisted. A load balancer sound more easy (and
> maybe more horizontal scalable).
>  http://www.dabeaz.com/python/GIL.pdf
> Excuse my poor english.
A little bit of knowledge...
Threads are indeed a possibility, because OpenSSL would be the thing
doing the SSL work, and given that you use OpenSSL via a C extension,
the C extension can release the GIL.
More information about the Twisted-web