-
Hi all, I'm starting a discussion here because I'm facing performance issue while moving my app from aiohttp v3.4.2 to v3.7.3 (python 3.6.12 under a debian slim buster container). The app is a kind of HTTP load balancer doing many things... I spotted the issue in the app. The problem comes from the time taken by the app to connect to its upstreams due to the following timeout constraints:
When testing with aiohttp 3.7.3 some connection can't established fast enough. This was not the case with aiohttp 3.4.2. The issue seems the be reproduced when the test app is running on a GCP compute instance e2-standard-8. It has few cores but spots the issue (from my point of view). Here are the results (quick summary):
Please find attached locust reports for more details. Does anybody has already experienced this kind of issue while upgrade to a newer version ? Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 19 replies
-
Hi all, Just a little update about the issue. Same problems are observed using Python 3.9.7 + aiohttp 3.7.3 on latest python debian slim base image. Benchmark tool is still there: Regards, |
Beta Was this translation helpful? Give feedback.
-
I think the reason is a little different. I believe you can increase timeouts to 1 sec to enable the ceiling; maybe all other parts of your system still work smoothly. Theoretically, we can add a configured threshold for switching to the ceiling approach but I really don't want to pollute the public API with esoteric parameters that are almost never used. |
Beta Was this translation helpful? Give feedback.
I think the reason is a little different.
After the mentioned change, your code schedules a lot of possible timeout events that pollute event loop internal structures even if timeouts never occur.
Before the change, all 'close' timeouts were grouped by scheduling at the ceiled time. Many possible scattered timeouts are grouped and called at most once per second, not 1000+ timeouts at different times during this second.
The ceiling works fine but caused problems with test environments that sometimes want to check timeout without relatively long waiting for a second. The ceiling now is processed only if timeout >= 1 sec, and disabled for tiny timeouts.
I believe you can increase timeouts to…