SSL Is Slow! My Fault? 
Author Message
 SSL Is Slow! My Fault?

I'm attempting to implement SSL in our website testing system.  It seems
to be working but it's really slow.  The attached example takes over 16
seconds against our in-house test page.  Against one of our potential
clients it took over 80 seconds just for HTTPSConnection.getresponse().

I built this from the ActiveState source distro on RedHat 7.  Could  I
have messed it up in some way?  Does anyone have an example of an SSL
client done right?

Doug Fort
Senior Meat Manager
Downright Software LLC
http://www.*-*-*.com/ ~dougfort

[ testhttplib.py < 1K ]
#!/usr/bin/env python
import httplib
import time

def test():

    connection = httplib.HTTPSConnection(
        "slytherin.downright.com"
        )
    connection.set_debuglevel(1)

    connection.connect()
    connection.putrequest("GET", "/top_logo.png")
    connection.endheaders()

    starttime = time.time()
    response = connection.getresponse()
    print "getresponse() %d %s elapsed %f" % (
        response.status, response.reason, time.time() - starttime
        )

if __name__ == "__main__":
    test()



Mon, 19 May 2003 03:00:00 GMT  
 SSL Is Slow! My Fault?
Hi,

There's about 3 times more traffic with HTTPS + encrypt/decrypt software
components running.
You'll notice that most pages on "good" sites available through HTTPS are
lightweight (no GIF/JPG...).



Quote:
> I'm attempting to implement SSL in our website testing system.  It seems
> to be working but it's really slow.  The attached example takes over 16
> seconds against our in-house test page.  Against one of our potential
> clients it took over 80 seconds just for HTTPSConnection.getresponse().

> I built this from the ActiveState source distro on RedHat 7.  Could  I
> have messed it up in some way?  Does anyone have an example of an SSL
> client done right?

> Doug Fort
> Senior Meat Manager
> Downright Software LLC
> http://www.dougfort.com/~dougfort

----------------------------------------------------------------------------
----
Quote:
> #!/usr/bin/env python
> import httplib
> import time

> def test():

>     connection = httplib.HTTPSConnection(
>         "slytherin.downright.com"
>         )
>     connection.set_debuglevel(1)

>     connection.connect()
>     connection.putrequest("GET", "/top_logo.png")
>     connection.endheaders()

>     starttime = time.time()
>     response = connection.getresponse()
>     print "getresponse() %d %s elapsed %f" % (
>         response.status, response.reason, time.time() - starttime
>         )

> if __name__ == "__main__":
>     test()



Tue, 20 May 2003 03:00:00 GMT  
 SSL Is Slow! My Fault?

The HTTP 1.0 code is MUCH faster.  See the attached example.  It runs in
.03s compared to 16+s for the HTTP 1.1 code.  There's something going on
here that I don't understand, and it's more than sheer volume.  I'd
really like to use (1.1) httplib.HTTPSConnection instead of (1.0)
httplib.HTTPS, because I  can't get the Keep-alive code I wrote for the
Python 1.52 version of httplib.HTTP to run with the Python 2.0 version
of hhttplib.HTTP.

Quote:

> Hi,

> There's about 3 times more traffic with HTTPS + encrypt/decrypt software
> components running.
> You'll notice that most pages on "good" sites available through HTTPS are
> lightweight (no GIF/JPG...).



>> I'm attempting to implement SSL in our website testing system.  It seems
>> to be working but it's really slow.  The attached example takes over 16
>> seconds against our in-house test page.  Against one of our potential
>> clients it took over 80 seconds just for HTTPSConnection.getresponse().

>> I built this from the ActiveState source distro on RedHat 7.  Could  I
>> have messed it up in some way?  Does anyone have an example of an SSL
>> client done right?

>> Doug Fort
>> Senior Meat Manager
>> Downright Software LLC
>> http://www.dougfort.com/~dougfort

> ----------------------------------------------------------------------------
> ----

>> #!/usr/bin/env python
>> import httplib
>> import time

>> def test():

>>     connection = httplib.HTTPSConnection(
>>         "slytherin.downright.com"
>>         )
>>     connection.set_debuglevel(1)

>>     connection.connect()
>>     connection.putrequest("GET", "/top_logo.png")
>>     connection.endheaders()

>>     starttime = time.time()
>>     response = connection.getresponse()
>>     print "getresponse() %d %s elapsed %f" % (
>>         response.status, response.reason, time.time() - starttime
>>         )

>> if __name__ == "__main__":
>>     test()

[ testHTTPS.py < 1K ]
#!/usr/bin/env python
import httplib
import time

def test():

    connection = httplib.HTTPS()
    connection.set_debuglevel(1)

    connection.connect("slytherin.downright.com")
    connection.putrequest("GET", "/top_logo.png")
    connection.endheaders()

    starttime = time.time()
    status, reason, headers = connection.getreply()
    print "getreply() %d %s elapsed %f" % (
        status, reason, time.time() - starttime
        )

if __name__ == "__main__":
    test()



Tue, 20 May 2003 03:00:00 GMT  
 SSL Is Slow! My Fault?

Quote:
> The HTTP 1.0 code is MUCH faster.  See the attached example.  It runs in
> .03s compared to 16+s for the HTTP 1.1 code.  There's something going on
> here that I don't understand, and it's more than sheer volume.  I'd
> really like to use (1.1) httplib.HTTPSConnection instead of (1.0)
> httplib.HTTPS, because I  can't get the Keep-alive code I wrote for the
> Python 1.52 version of httplib.HTTP to run with the Python 2.0 version
> of hhttplib.HTTP.

Where I sit, I get the following:

    /usr/local/home/ngps:$ python
    Python 2.0 (#4, Oct 18 2000, 23:09:30)
    [GCC 2.95.2 19991024 (release)] on freebsd4
    Type "copyright", "credits" or "license" for more information.
    >>> from M2Crypto import httpslib
    >>> import time
    >>> def test():
    ...     c = httpslib.HTTPSConnection('slytherin.downright.com')
    ...     c.set_debuglevel(1)
    ...     c.connect()
    ...     c.putrequest('GET', '/top_logo.png')
    ...     c.endheaders()
    ...     st = time.time()
    ...     resp = c.getresponse()
    ...     print '%d %s %f' % (resp.status, resp.reason, time.time() - st)
    ...
    >>> test()
    send: 'GET /top_logo.png HTTP/1.1\015\012'
    send: 'Host: slytherin.downright.com\015\012'
    send: 'Accept-Encoding: identity\015\012'
    send: '\015\012'
    reply: 'HTTP/1.1 200 OK\015\012'
    header: Date: Fri, 01 Dec 2000 16:46:20 GMT
    header: Server: Apache/1.3.9 (Unix) Red-Hat-Secure/3.1 mod_ssl/2.4.5 OpenSSL/0.9.4
    header: Last-Modified: Tue, 26 Sep 2000 17:41:30 GMT
    header: ETag: "33b23-2ac9-39d0dfca"
    header: Accept-Ranges: bytes
    header: Content-Length: 10953
    header: Content-Type: image/png
    200 OK 1.026595

1.02sec.

This is M2Crypto 0.05 on Python 2.0, not Python 2.0's built-in SSL.

/usr/local/home/ngps:$ traceroute slytherin.downright.com
traceroute to slytherin.downright.com (206.239.40.165), 30 hops max, 40 byte packets
 1  as6047.singnet.com.sg (165.21.207.5)  108.582 ms  99.294 ms  89.921 ms
 2  fd-3-0-0-eunos.singnet.com.sg (165.21.102.3)  109.659 ms  99.335 ms  100.078 ms
 3  GE-1-1-0.bedok.singnet.com.sg (165.21.12.1)  109.478 ms  89.862 ms  99.683 ms
 4  POS2-0.tp-core1.ix.singtel.com (202.160.250.53)  89.689 ms  89.351 ms  89.920 ms
 5  POS1-0.tp-core2.ix.singtel.com (202.160.250.150)  329.664 ms POS0-1.above-core1.ix.singtel.com (202.160.250.34)  319.559 ms POS1-0.tp-core2.ix.singtel.com (202.160.250.150)  309.822 ms
 6  POS2-0.paix-core1.ix.singtel.com (202.160.250.46)  309.274 ms  329.829 ms  329.610 ms
 7  POS6-1-0.paix-peer1.ix.singtel.com (202.160.250.50)  579.738 ms  369.694 ms  319.856 ms
 8  f0.pao1.verio.net (198.32.176.14)  339.575 ms  319.519 ms  320.045 ms
 9  p4-0-0.r05.plalca01.us.bb.verio.net (129.250.2.129)  329.836 ms  329.805 ms  309.638 ms
10  p4-0-2.r00.mclnva02.us.bb.verio.net (129.250.2.246)  429.835 ms  419.365 ms  419.907 ms
11  fa-1-1-0.a04.vinnva01.us.ra.verio.net (129.250.30.170)  409.539 ms  599.546 ms  559.883 ms
12  fa-1-0-0.a03.vinnva01.us.ra.verio.net (207.22.81.15)  419.915 ms  419.767 ms  419.706 ms
13  168.143.228.118 (168.143.228.118)  419.940 ms  429.568 ms  419.834 ms
14  206.239.40.37 (206.239.40.37)  429.949 ms  439.566 ms  399.862 ms
15  10.1.1.5 (10.1.1.5)  419.988 ms  419.611 ms  429.941 ms
16  206.239.40.165 (206.239.40.165)  429.795 ms  429.381 ms  430.301 ms

16 hops from my desktop to your server.

Cheers.

--



Tue, 20 May 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. why am i getting processor stack fault error?

2. slow - am I asking too much

3. Turbo-Fault--Fault Simulation

4. I am not deaf, but am I mute?

5. slow, very slow

6. Loop with Write key.vi goes slower and slower

7. SysCreateObject gets slower and slower

8. Slow file access - Slow program startup

9. Tcl getting slower and slower on HP-UX

10. Swazoo 0.9.60 with SSL support released

11. APL+Win 4.0, SSL and []ni

12. Anyone working on SSL?

 

 
Powered by phpBB® Forum Software