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

Fix katana consuming all cpu #362

Merged
merged 3 commits into from
Mar 20, 2023
Merged

Fix katana consuming all cpu #362

merged 3 commits into from
Mar 20, 2023

Conversation

ShubhamRasal
Copy link
Contributor

@ShubhamRasal ShubhamRasal commented Mar 20, 2023

  • consider a scenario of url is some icon or css url
  • it does not have any more urls to traverse, at that time
  • it was looping and checking if queue is nil or not for 10s.
  • if we are passing multiple urls, then it consume all the CPU
  • coz, infinite loop and using time.Now() in for loop.
  • now, it will check after 1s.

- working this, using less cpu
- if queue is nil, loop for next 10s to see if there is new entry in
  queue
- looping this 10s consumes cpu
- consider a scenario of url is some icon or css url
- it does not have any more urls to traverse, at that time
- it was looping and checking if queue is nil or not for 10s.
- if we are passing multiple urls, then it consume all the CPU
- coz, infinite loop and using time.Now() in for loop.
- now, it will check after 1s.
@ShubhamRasal ShubhamRasal self-assigned this Mar 20, 2023
@ShubhamRasal ShubhamRasal linked an issue Mar 20, 2023 that may be closed by this pull request
@ShubhamRasal ShubhamRasal changed the title Fix katana consuming 100% cpu Fix katana consuming all cpu Mar 20, 2023
@ShubhamRasal
Copy link
Contributor Author

  • Using dev branch
    image

  • using this PR
    image

@ShubhamRasal ShubhamRasal added the Status: Review Needed The issue has a PR attached to it which needs to be reviewed label Mar 20, 2023
@Mzack9999 Mzack9999 merged commit 5385693 into dev Mar 20, 2023
@Mzack9999 Mzack9999 deleted the fix-cpu-consume branch March 20, 2023 07:35
@Mzack9999 Mzack9999 added Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. and removed Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Status: Review Needed The issue has a PR attached to it which needs to be reviewed labels Mar 20, 2023
@ehsandeep ehsandeep removed their request for review March 20, 2023 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

katana consuming all CPU?
2 participants