llamasoft opened a new pull request, #1886:
URL: https://github.com/apache/libcloud/pull/1886

   If the connection host/port/secure hasn't changed then the current 
connection can be reused.  
   This greatly reduces overhead when doing bulk actions such as storage object 
downloads.  
   
   In testing with bulk downloading storage objects, this resulted in an 
overall 2x throughput increase.
   
   ## Enables OpenStack connection reuse
   
   ### Description
   
   The underlying `common.base.Connection` object reuses connections (via 
`LibcloudConnection` -> Requests Session -> urllib3 connection pool) but the 
OpenStack's driver discards this every time it makes a new request.  This 
results in a large amount of time spent opening connections and verifying SSL 
certificates.  The proposed change only creates a new connection if any of the 
host/port/secure settings have changed.
   
   In theory, for HTTP-based providers there is never a need to explicitly 
create a new connection because the [underlying Requests/urllib3 
libraries](https://github.com/apache/libcloud/blob/d163f9ba5938aff7d23dec72fa549a482f6836c7/libcloud/http.py#L228-L255)
 will create new connections as needed.  However, the underlying 
`LibcloudConnection` class treats host an immutable, so the session it creates 
will only ever be used for a single host/port.  For this reason, we only need 
to re-`connect()` when the host/port changes.
   
   ### Status
   
   Done, ready for review.
   
   ### Checklist (tick everything that applies)
   
   - [X] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
   - [ ] Documentation
   - [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
   - [ ] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to