Pzhang
Pzhang

Reputation: 361

Python module urllib3: increase the `maxsize` (max pool size) of HTTPSConnectPool to a host, it make the https request slower

I have a code to test the HTTPS requests speed. I use urllib3 module and eventlet.

The code is simple just like below, the pool max size is maxsize=1000.

# -*- coding: utf-8 -*-
import eventlet
eventlet.monkey_patch()
import urllib3
import json

vss=[
    "Project_0ef86f5b-59ab-4036-b460-035fba7cbae2",
] * 20

urls = [
    "https://123.123.123.244:443/mgmt/tm/ltm/virtual/" + \
        "~" + "Project_8a2d7296ae9b4bd4a412eb3cb9aa680e" + "~" + vs
    for vs in vss
]

if __name__ == "__main__":
    http = urllib3.PoolManager(num_pools=2, maxsize=1000)
    headers = urllib3.make_headers(basic_auth='admin:test')
    headers['Content-Type'] = "application/json"

    body = {"connectionLimit": 123}
    encoded_data = json.dumps(body)

    pool = eventlet.greenpool.GreenPool()
    for url in urls:
        pool.spawn(http.request, 'GET', url, headers=headers)
    pool.waitall()

I do some hard code to print some time elapses:

[root@ci-4183549-rdo-pzhang test_icontrol]# python icontrol_get_test.py
Build NEW connection time elapse is 0.001942
Build NEW connection time elapse is 0.012094
Build NEW connection time elapse is 0.013818
Build NEW connection time elapse is 0.013012
Build NEW connection time elapse is 0.007247
Build NEW connection time elapse is 0.010341
Build NEW connection time elapse is 0.013482
Build NEW connection time elapse is 0.020885
Build NEW connection time elapse is 0.013927
Build NEW connection time elapse is 0.009739
Build NEW connection time elapse is 0.016819
Build NEW connection time elapse is 0.015231
Build NEW connection time elapse is 0.022680
Build NEW connection time elapse is 0.013895
Build NEW connection time elapse is 0.015198
Build NEW connection time elapse is 0.035994
Build NEW connection time elapse is 0.024190
Build NEW connection time elapse is 0.017719
Build NEW connection time elapse is 0.013729
Build NEW connection time elapse is 0.013873
EVENTLET GREEN SSL time elapse is 0.051242
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.051957
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.054515
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000169
EVENTLET GREEN SSL time elapse is 0.049463
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.049840
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.060299
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000094
EVENTLET GREEN SSL time elapse is 0.047258
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.047623
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.057479
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000150
EVENTLET GREEN SSL time elapse is 0.057035
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.057440
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.069707
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000529
EVENTLET GREEN SSL time elapse is 0.053266
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.053610
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.067651
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000216
EVENTLET GREEN SSL time elapse is 0.058025
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.058406
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.072347
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000122
EVENTLET GREEN SSL time elapse is 0.073248
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.073845
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.095143
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000396
EVENTLET GREEN SSL time elapse is 0.084811
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.085183
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.098409
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000165
EVENTLET GREEN SSL time elapse is 0.084291
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.084646
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.098489
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000523
EVENTLET GREEN SSL time elapse is 0.086874
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.087236
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.094723
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000176
ACTUAL REQUEST time elapse is 0.150891
ACTUAL REQUEST time elapse is 0.166222
ACTUAL REQUEST time elapse is 0.172489
ACTUAL REQUEST time elapse is 0.208163
ACTUAL REQUEST time elapse is 0.223595
ACTUAL REQUEST time elapse is 0.228818
ACTUAL REQUEST time elapse is 0.241930
ACTUAL REQUEST time elapse is 0.234952
ACTUAL REQUEST time elapse is 0.245768
ACTUAL REQUEST time elapse is 0.253769



EVENTLET GREEN SSL time elapse is 6.222013
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.222441
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.239439
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000201
EVENTLET GREEN SSL time elapse is 6.234959
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.235361
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.258194
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000168
EVENTLET GREEN SSL time elapse is 6.241790
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.242165
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.257899
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000671
EVENTLET GREEN SSL time elapse is 6.280445
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.280884
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.295080
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000187
EVENTLET GREEN SSL time elapse is 6.299682
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.300054
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.315421
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000275
EVENTLET GREEN SSL time elapse is 6.308870
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.309240
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.345404
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000193
EVENTLET GREEN SSL time elapse is 6.345892
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.346267
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.360176
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000186
EVENTLET GREEN SSL time elapse is 6.363362
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.363804
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.388216
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000305
EVENTLET GREEN SSL time elapse is 6.368939
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.369322
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.387182
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000407
EVENTLET GREEN SSL time elapse is 6.373431
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 6.373835
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 6.387855
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000180
ACTUAL REQUEST time elapse is 0.172811
ACTUAL REQUEST time elapse is 0.195098
ACTUAL REQUEST time elapse is 0.187940
ACTUAL REQUEST time elapse is 0.136162
ACTUAL REQUEST time elapse is 0.213076
ACTUAL REQUEST time elapse is 0.145465
ACTUAL REQUEST time elapse is 0.194409
ACTUAL REQUEST time elapse is 0.150222
ACTUAL REQUEST time elapse is 0.152019
ACTUAL REQUEST time elapse is 0.182908

From the above log, There are 20 requests sent, I find it very slow to do the first HTTPS connection SSL validation (as log SLOW validate). And it seems every 10 requests is about 5-6 seconds slower than previous requests.

after the SSL validation handshake, I also log the new connection time Build NEW and actual request time ACTUAL REQUEST, they seem faster than the SSL handshake.

The weird things happened, when I change the pool max size to 1 as maxsize=1. the code is just as below:

ACTUAL REQUEST time elapse is 0.166906
# -*- coding: utf-8 -*-
import eventlet
eventlet.monkey_patch()
import urllib3
import json

vss=[
    "Project_0ef86f5b-59ab-4036-b460-035fba7cbae2",
] * 20

urls = [
    "https://123.123.123.244:443/mgmt/tm/ltm/virtual/" + \ 
        "~" + "Project_8a2d7296ae9b4bd4a412eb3cb9aa680e" + "~" + vs
    for vs in vss
]

if __name__ == "__main__":
    http = urllib3.PoolManager(num_pools=2, maxsize=1)
    headers = urllib3.make_headers(basic_auth='admin:test')
    headers['Content-Type'] = "application/json"

    body = {"connectionLimit": 123}
    encoded_data = json.dumps(body)

    pool = eventlet.greenpool.GreenPool()
    for url in urls:
        pool.spawn(http.request, 'GET', url, headers=headers)
    pool.waitall()

The only change is maxsize=1. Then I run the code again. I found it faster than before. And the log is:

[root@ci-4183549-rdo-pzhang test_icontrol]# python icontrol_get_test.py
Build NEW connection time elapse is 0.015360
Build NEW connection time elapse is 0.017999
Build NEW connection time elapse is 0.025342
Build NEW connection time elapse is 0.021459
Build NEW connection time elapse is 0.023889
Build NEW connection time elapse is 0.026711
Build NEW connection time elapse is 0.031111
Build NEW connection time elapse is 0.027637
Build NEW connection time elapse is 0.023971
Build NEW connection time elapse is 0.025077
Build NEW connection time elapse is 0.030668
Build NEW connection time elapse is 0.029985
Build NEW connection time elapse is 0.034746
Build NEW connection time elapse is 0.028624
Build NEW connection time elapse is 0.029502
Build NEW connection time elapse is 0.037975
Build NEW connection time elapse is 0.036091
Build NEW connection time elapse is 0.031267
Build NEW connection time elapse is 0.022034
Build NEW connection time elapse is 0.021854
EVENTLET GREEN SSL time elapse is 0.050881
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.051288
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.075853
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000185
EVENTLET GREEN SSL time elapse is 0.058581
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.066372
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.084548
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000120
EVENTLET GREEN SSL time elapse is 0.062094
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.062490
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.089335
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000427
EVENTLET GREEN SSL time elapse is 0.060111
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.060585
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.085756
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000099
EVENTLET GREEN SSL time elapse is 0.066614
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.067027
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.088786
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000196
EVENTLET GREEN SSL time elapse is 0.065821
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.066171
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.097392
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000093
EVENTLET GREEN SSL time elapse is 0.082791
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.083365
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.098947
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000248
EVENTLET GREEN SSL time elapse is 0.074760
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.075168
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.099560
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000750
EVENTLET GREEN SSL time elapse is 0.078279
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.078932
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.105360
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000234
EVENTLET GREEN SSL time elapse is 0.076575
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.077019
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.105298
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000373
ACTUAL REQUEST time elapse is 0.151813
ACTUAL REQUEST time elapse is 0.179453
ACTUAL REQUEST time elapse is 0.184682
ACTUAL REQUEST time elapse is 0.207302
EVENTLET GREEN SSL time elapse is 0.270626
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.271068
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.301941
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000250
EVENTLET GREEN SSL time elapse is 0.276534
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.276893
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.307036
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000199
EVENTLET GREEN SSL time elapse is 0.277267
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.277619
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.312475
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000135
ACTUAL REQUEST time elapse is 0.229100
ACTUAL REQUEST time elapse is 0.219073
ACTUAL REQUEST time elapse is 0.241250
ACTUAL REQUEST time elapse is 0.243543
EVENTLET GREEN SSL time elapse is 0.325758
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.326065
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.354829
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000165
EVENTLET GREEN SSL time elapse is 0.329577
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.329849
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.366091
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000175
EVENTLET GREEN SSL time elapse is 0.331157
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.331404
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.361000
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000110
ACTUAL REQUEST time elapse is 0.266746
EVENTLET GREEN SSL time elapse is 0.341352
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.341600
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.379702
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000261
ACTUAL REQUEST time elapse is 0.278251
EVENTLET GREEN SSL time elapse is 0.362323
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.362653
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.394090
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000209
EVENTLET GREEN SSL time elapse is 0.372634
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.372951
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.395210
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000165
ACTUAL REQUEST time elapse is 0.158835
ACTUAL REQUEST time elapse is 0.154795
ACTUAL REQUEST time elapse is 0.180860
EVENTLET GREEN SSL time elapse is 0.457490
URLLIB3 CONNECTION SLOW TIME after build new connection time elapse is 0.457814
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:855: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/security.html
  InsecureRequestWarning)
SLOW validate connection time elapse is 0.479805
CONNECTIONPOOL after ssl validation Request with ARGS connection time elapse is 0.000156
ACTUAL REQUEST time elapse is 0.165210
ACTUAL REQUEST time elapse is 0.170411
ACTUAL REQUEST time elapse is 0.183082
ACTUAL REQUEST time elapse is 0.182051
ACTUAL REQUEST time elapse is 0.173406
ACTUAL REQUEST time elapse is 0.195164
ACTUAL REQUEST time elapse is 0.144579

As you can see, the SSL validation time SLOW validate for each request is decreased dramatically.

I dig the code to eventlet ssl, and I find it also slow (as log EVENTLET GREEN SSL indicates) when maxsize is 1000, and it becomes faster when the maxsize is 1.

I do not get why it behaves like this. I am sure it may be related to the urllib3 module since its parameter does change the performance.

Anyone could give me some hints, Thanks a lot.

Upvotes: 1

Views: 1046

Answers (0)

Related Questions