SystemRage / py-kms

KMS Server Emulator written in Python
The Unlicense
2.04k stars 618 forks source link

100% CPU usage... #83

Closed lepoarro closed 3 years ago

lepoarro commented 3 years ago

After updating Docker version to the latest build, I noticed that Docker environment was utilizing 100% of 1 CPU core of 4 given to my Docker environment under Unraid OS. First I thought that there was a problem with new py-kms Docker image and I tried to run py-kms in Debian VM to see if the python only version has the same problem and yes same issue exists.

Running old python3 version: old

Running new python3 version: new

Docker environment: docker

Hope this information helps!

simonmicro commented 3 years ago

Okay, that is strange. Well, we've had this before https://github.com/SystemRage/py-kms/issues/38 - and then fixed. Additionally I had fixed this in #51 for docker. But you are right. It is here again. I can reproduce this and will take a look further into it.

lepoarro commented 3 years ago

It seems Fix for#58 messes up the CPU usage under Linux. I rolled back the fix in pykms_Server.py file and the CPU usage went back to normal. I'm not the python expert, so can't really understand what is the real problem, just tried to roll back latest fixes to see if something changes and it did.

simonmicro commented 3 years ago

Now you mention it - it has nothing to do with the issues / problem from before. Maybe @SystemRage can take a look at it...

SystemRage commented 3 years ago

i don't know why, but he didn't like selector.register(fileobj = self.w_service.fileno(), events = selectors.EVENT_WRITE)