Performance evaluation of HTTPS library
amvyas82 at gmail.com
Wed Oct 13 14:27:29 CEST 2010
On Oct 13, 3:19 pm, Antoine Pitrou <solip... at pitrou.net> wrote:
> On Wed, 13 Oct 2010 02:12:21 -0700 (PDT)
> Ashish <amvya... at gmail.com> wrote:
> > > > Is the client machine at 100% CPU when you do that?
> > > With HTTP, I see client CPU at appx. 97%. However with HTTPS, it stays
> > > at 53-55%.
> And is the server at 100% CPU then?
> If the client is not at 100% CPU, it shouldn't be the bottleneck,
> unless you have something wrong in the client implementation.
> > > sock = socket.create_connection((self.host, self.port),
> > > self.timeout)
> > > sock2 = ssl.wrap_socket(sock, self.key_file,
> > > self.cert_file)
> > > self.sock = CBSocket(sock2)
> What is CBSocket? What happens if you just write:
> self.sock = sock2
Server's java process is taking 15% cpu.
Well, CBSocket is socket implementation that calls my callback on
Both my classes AsyncHTTPSConnection and AsyncHTTPConnection use it
and use it the same way ( self.sock = CBSocket(sock2) ).
The implemetation of AsyncHTTPConnection differs from
AsyncHTTPSConnection only in connect method: sock2 =
ssl.wrap_socket(sock, self.key_file, self.cert_file)
""" This is a class that calls the callback when it has data and
it read it."""
def __init__(self, socket):
self._in_buffer = io.BytesIO()
self._closed = False
self._cb = None
read = self.socket.recv(65536)
read = 0
if not read and not self._closed:
self._closed = True
def sendall(self, data):
def makefile(self, mode, buffsize= 8192):
def set_cb(self, cb):
self._cb = cb
self._closed = True
> > > > Also, there's a feature request to reduce overhead of SSL
> > > > connections, but it needs implementing:http://bugs.python.org/issue8106
> > > Well good to know this. Do we have any date when this will be
> > > available? I feel like contributing to this but kind of over occupied
> > > with several activities right now.
> Probably not in Python 3.2 anyway. But given your client isn't at 100%
> CPU when you launch your HTTPS test, it might not make a lot of
More information about the Python-list