-
Notifications
You must be signed in to change notification settings - Fork 245
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
100% CPU in rpyc 3.4 #218
Comments
Thanks, I will investigate this weekend. Can you show a minimal working example? |
Yes, apologies; I should have done that initially. I'm working on it now, and of course my minimal example works fine... it might take me a bit to identify what aspect of my architecture is triggering the issue. I have found that the issue occurs when the server is run in Python 2.7.12 but not when it is run in Python 3.5.2 (rpyc 3.4.0 in both cases). And it only occurs after a client connects. I'll keep working on a minimal example. |
Okay, here is a minimal working example:
import rpyc
from rpyc.utils.server import ThreadedServer
class service(rpyc.Service):
def exposed_func(self):
print("Hi!")
server = ThreadedServer(service, hostname='localhost', port=4158)
server.start()
import rpyc
import time
rpc = rpyc.connect("localhost", 4158)
# test to verify connection
rpc.root.func()
time.sleep(1000) When run with Python 2.7.12 (Ubuntu 16.04), |
Hi. Seems this issue is fixed with 12544f4. Can you check with current master whether you still experience problems? If not, I will release a bugfix release shortly. |
Yes, the issue does appear to be fixed after installing rpyc from master. (I had even seen that commit, and I thought I had tried that fix manually... oh well.) Thanks! |
Thanks for your report! Bugfix release 3.4.1 now on PyPI. |
After upgrading to rpyc 3.4, my server process started spinning on the CPU somewhere. Reverting to 3.3 removes the issue entirely.
Specifically, I see ~140% CPU usage when using ThreadedServer, and with ForkingServer, both processes (after forking) use 100% CPU. A bit of profiling pointed to a poll() method as a culprit, but I haven't been able to dig further.
The text was updated successfully, but these errors were encountered: