
Hello, I used Twisted to write some kind of proxy and it's working great, it's so easy to develop and understand. But I have a problem. I use SSL (on both side of this app) and the bandwidth available is limited to the power of one of my CPU due to the high cost of the SSL encryption. I would like to use both core of my CPU to increase the bandwidth of this application but it does not seem easy to do. # Here is the server definition in myapp.tac from twisted.application import internet, service application = service.Application('MyApp', uid=1001, gid=1001) internet.SSLServer(80, serverFactory, MySSLContext(), 50, 'xxx.xxx.xxx.xxx').setServiceParent(service.IServiceCollection(application)) # And here the clients connections from twisted.internet import reactor, ssl mySSLContext = ssl.ClientContextFactory() mySSLContext.method = SSL.SSLv23_METHOD reactor.connectSSL(self.HOST, self.PORT, self, mySSLContext) Does anyone already have this kind of problem? Is there an easy way to multithread the SSL encryption part? Thank you, Yann from France.

Yann Pomarede wrote:
Hello,
I used Twisted to write some kind of proxy and it's working great, it's so easy to develop and understand.
But I have a problem. I use SSL (on both side of this app) and the bandwidth available is limited to the power of one of my CPU due to the high cost of the SSL encryption. I would like to use both core of my CPU to increase the bandwidth of this application but it does not seem easy to do.
# Here is the server definition in myapp.tac from twisted.application import internet, service application = service.Application('MyApp', uid=1001, gid=1001) internet.SSLServer(80, serverFactory, MySSLContext(), 50, 'xxx.xxx.xxx.xxx').setServiceParent(service.IServiceCollection(application))
# And here the clients connections from twisted.internet import reactor, ssl mySSLContext = ssl.ClientContextFactory() mySSLContext.method = SSL.SSLv23_METHOD reactor.connectSSL(self.HOST, self.PORT, self, mySSLContext)
Does anyone already have this kind of problem? Is there an easy way to multithread the SSL encryption part?
You could run two instances and load balance them... d
participants (2)
-
Duncan M. McGreggor
-
Yann Pomarede