ably / ably-python

Python client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
49 stars 24 forks source link

Replace httpx with request for sync version #543

Open sacOO7 opened 1 year ago

sacOO7 commented 1 year ago

┆Issue is synchronized with this Jira Task by Unito

sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3914

sacOO7 commented 11 months ago

TODO

@owenpearson has an idea about how to reproduce the issue and do the load testing.

sacOO7 commented 11 months ago

Some more findings ->

sacOO7 commented 11 months ago

One of the related fix seems to be -> https://github.com/encode/httpcore/pull/823

sacOO7 commented 11 months ago

The current SDK only supports httpx to be used in http2 mode -> https://github.com/ably/ably-python/blob/10cb4a08c64f915a2878ffd1139b08a50811124d/ably/http/http.py#L132. There is still an active issue for http2 -> https://github.com/encode/httpcore/issues/775 that talks about gracefully closing the connection. Fix is already done for http1.1.

sacOO7 commented 11 months ago

NEW TODO

Ousret commented 9 months ago

I don't know whether it could help your case, but you may consider taking a look at Niquests instead of downgrading to requests. Your feedback would be interesting. Would be happy to get this project where you aim to reach.

sacOO7 commented 9 months ago

@Ousret Thanks for the suggestion !

sacOO7 commented 9 months ago

Seems we can use https://locust.io/ as a tool for load testing.

sacOO7 commented 9 months ago

https://medium.com/@yusufenes3494/how-to-build-your-own-load-test-a-step-by-step-guide-1a8367f7f6a2

Seems locusts by default uses python-requests for executing test against given server https://docs.locust.io/en/stable/increase-performance.html. No wonder, python-requests is stable and doesn't cause issue on high throughput.

Need to check if we can configure other client like httpx instead of default python-requests

sacOO7 commented 9 months ago

One of the way is to clone python-locust project and modify https://github.com/locustio/locust/blob/master/locust/clients.py file to use httpx client instead of python-requests. This will help us to use all features of locust client like result tracking, without writing explicit code for the same.