gevent_uwsgi use more cpu #237
Replies: 7 comments
|
This code was contributed to the project many years ago. I do not use uwsgi and I'm not familiar with its internals, so I can't really answer your questions. I fail to see how a timeout of 3 seconds can cause a big performance issue, however. Do you want to share your testing code so that I can try this myself? |
|
The test code in #228 can reproduce as well. When ALL_USER = 5000, the uwsgi process use 25% cpu shown by |
|
The code that you sent me to use is not a good benchmark. It has the following problems:
|
|
Did you try debugging this code to see what those incoming events are? As I said, this was contributed to the project about 5 years ago, and I accepted it assuming the contributor knew what they were doing. I just confirmed that it works, but did not really do an in-depth analysis. If you find ways to improve this code I'm all for doing it. |
|
Well, it's hard to debug, since I didn't meet a case that need timeout. As I said, after changing timeout to 3*100000, all seem working well. Maybe it just wakes up to do uwsgi ping/pong as the comment says. Perhaps the way to solve this or similar problem is engineio can support a custom async driver, so that user can write their own code without modifying the source. Anyway, thanks for communication. |
|
Similar to what we've been experiencing, possibly #296 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
HI, I'm testing the performance between gevent_uwsgi and gevent. The test case is 5000 connection only send PING/PONG.
The result is that gevent_uwsgi use almost twice cpu than gevent. I modify the
self._event.wait(timeout)in curious, and then gevent_uwsgi use almost same cpu as gevent.The uwsgi version I used is 2.0.19.1, the latest version in pypip, which is also the latest version in uwsgi documentation. So the gevent_uwsgi will wake up every 3 seconds. The comment said that it wake up for uwsgi ping/pong. But I don't understand why engineio need do uwsgi ping/pong again, since it already did its ping/pong. Is it because the uwsgi default config
websocket-ping-freqandwebsocket-pong-tolerance?All reactions