Skip to content
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 Consumption #1

Open
richp10 opened this issue Oct 14, 2017 · 6 comments
Open

100% CPU Consumption #1

richp10 opened this issue Oct 14, 2017 · 6 comments

Comments

@richp10
Copy link
Contributor

richp10 commented Oct 14, 2017

Firstly thanks for this auth package. I have been using it a while with changes only to the isuser and auth methods for my own tweaked database needs.

Only issue is that running top, the program is showing as using 100% of cpu - it's a multi-core machine and I think it is hogging one core. This is happening at steady state, when there are no new authentication events.

My golang knowledge is not sufficient to know whether the authloop was sufficiently expensive to hog the cpu in this way. Any thoughts? Do you have this problem?

@antham
Copy link

antham commented Oct 15, 2017

I wrote a go binary for ejabber for exactly the same purpose and had an issue as well with high cpu consumption because auth for loop was processing endlessly.

@safchain
Copy link
Owner

Thanks for reporting this. I will have a look tomorrow.

@richp10
Copy link
Contributor Author

richp10 commented Oct 25, 2017

Hi - did you get chance to look at this? Thanks..

@richp10
Copy link
Contributor Author

richp10 commented Mar 29, 2018

I think I solved this by adding a short timer to the listen loop.. please see the thread on Stackoverflow: https://stackoverflow.com/questions/49540585/excessive-cpu-usage-on-golang-stdin-loop

@safchain
Copy link
Owner

@richp10 thanks, can you submit a PR ?

@richp10
Copy link
Contributor Author

richp10 commented Mar 29, 2018

Yup will do..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants