opened
zhangi
username_0
Not sure if this is a bug from urllib3 or requests, the problem is that there is an extra delay introduced for all subrequests other than the first one when reusing a session object.
The test are performed in Ubuntu 14 to a http server running on the localhost
```python
with requests.Session() as session:
    session.get(url) # this takes <1ms
    session.get(url) # this takes around 40ms
    session.get(url) # this takes around 40ms
```
Similar case was observed in httplib2 with Python 2.6(https://code.google.com/p/httplib2/issues/detail?id=91), and was fixed in Python 2.7.
Persistent Connection suffer from delay of Nagle
issue
created
Lukasa
username_1
comment
created
zhangi
username_0
version: 2.9.1
installed by: sudo pip install requests --upgrade
comment
created
Lukasa
username_1
So [we disable Nagle's algorithm by default](https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/connection.py#L97), which means that your diagnosis of this cannot be right.

Are you familiar with wireshark or tcpdump?
comment
created
zhangi
username_0
Let me investigate more, maybe it has something to do with server side. I will close it first.
comment
closed
zhangi
username_0
issue
created
Lukasa
username_1
To be clear, if the server-side has delayed ACKs turned on it may cause this problem.
comment