-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After migrating to 1.3.3 there is 100% CPU usage and memory leak after some time #1667
Comments
could you try 1.3 branch, I made some changes |
I reproduced it with OS X too, so it's probably not OS dependent. We tried ccdab64 on both OS X and Linux and it still leaks. Script work good for a while and then CPU usage goes to 100% and memory leaks very quickly. In my code there's |
@misiek08 I can not reproduce the leak. could you modify |
I can not really test your script because you use some internal service |
I replaced your
|
To fix your issue you should either reuse TCPConnector for all the requests or properly close it when it needs no more or may be disable keep alive feature. |
@kxepal I use python-consul and it's aio part and there I see leaks. I can't reuse TCPConnector, because I wonna keep long-polling collections for 50-60 services. This internal service is just Consul, so you can set a standard Consul cluster and make there some changes. I don't see any problem with except, client should be collected, because I don't keep any reference. I use exactly the same code with 1.2.0 and 1.3.3, so this doesn't look as problem on my side, because we use similar code in production for few days and with 1.2.0 there is no problem. After upgrading to 1.3.3 the problem appears after few seconds. Of course - the more tasks and connection you open, the bigger and faster leak gets. |
I wasn't able to reproduce that, but I had a success with your example in initial post here.
Well, if you use the consul client it does share the same TCPConnector for all the requests, so you won't hit that problem. And this is what I observe. I see no problem here. Also, what kind of problem are you trying to solve by such kind of action? Just curious.
It hides the real issue from you. I was ended with:
You didn't, but internally, TCPConnector keeps sockets open for keepalive timeframe unless it was explicitly closed and it won't being collected untill all the connections will get closed. You usage of it is just wrong here. Try to close the connector in your |
To watch changes in consul for different services.
I understand that some objects are not getting deleted, but I'm just curious why same code work without any problems on aiohttp==1.2.0 and leaks very badly at 1.3.3 (I tried only 1.2.0 and 1.3.3, but no other version in between). |
could you try this https://github.com/aio-libs/aiohttp/ |
@fafhrd91 which one aiohttp is official now then? |
We are migrating development to aio-libs organization
…Sent from my iPhone
On Mar 13, 2017, at 12:21 AM, Mateusz Kurek ***@***.***> wrote:
@fafhrd91 which one aiohttp is official now then?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
2.0 should fix this problem |
Long story short
After upgrading 1.2.0 to 1.3.3 there are CPU overusages and memory leaks on Linux (Ubuntu 16.04).
Works good on OS X 10.12.3 (Sierra) or the bug shows after too long time. I tried same script on OS X and Ubuntu and Ubuntu starts leaking after 15-30 seconds.
Expected behaviour
No 100% CPU usage and memory leaks during whole time.
Actual behaviour
100% CPU usage and memory leaks (even 1MB/s on many clients).
Steps to reproduce
Your environment
Ubuntu 16.04
The text was updated successfully, but these errors were encountered: