GithubHelp home page GithubHelp logo

program crashes somewhere when the browser is launched and chromium starts to consume very high cpu about codezinger-due-date-scraper HOT 6 CLOSED

roguedbear avatar roguedbear commented on July 17, 2024
program crashes somewhere when the browser is launched and chromium starts to consume very high cpu

from codezinger-due-date-scraper.

Comments (6)

RoguedBear avatar RoguedBear commented on July 17, 2024

update: when this happens, the bot doesn't post anything on discord.
possible source of error could be these lines since:

browser = await launch(executablePath=chrome_path,
headless=True,
options={'args': ['--no-sandbox']})
page = await browser.newPage()

since they're not under try/except


relevant log files:
image
red is the last log and since when the chromium high cpu usage is started
green is when i manually restarted the container

from codezinger-due-date-scraper.

RoguedBear avatar RoguedBear commented on July 17, 2024

processed running when cpu usage is high:
image

Last log message:
image

from codezinger-due-date-scraper.

RoguedBear avatar RoguedBear commented on July 17, 2024

possible workarounds:

  • if opening chrome or that process takes more than 90seconds, kill it and restart
    (and/or set a cpu limit in compose)
  • add the --disable-gpu param
  • downgrade to python 3.9
  • install all puppeteer's dependencies

from codezinger-due-date-scraper.

RoguedBear avatar RoguedBear commented on July 17, 2024

exact LOC where the freezing happens (confirmed via logs):

page = await browser.newPage()

Logs when the program freezes:

crond: USER root pid   9 cmd /entrypoint.sh
codezinger-due-date-scraper  Copyright (C) 2022  RoguedBear, Ya-s-h
    This program comes with ABSOLUTELY NO WARRANTY; see COPYING
    This is free software, and you are welcome to redistribute it
    under certain conditions; see COPYING
loaded short names
Starting browser...
browser started

Logs when the program runs normally

crond: USER root pid   9 cmd /entrypoint.sh
codezinger-due-date-scraper  Copyright (C) 2022  RoguedBear, Ya-s-h
    This program comes with ABSOLUTELY NO WARRANTY; see COPYING
    This is free software, and you are welcome to redistribute it
    under certain conditions; see COPYING
loaded short names
Starting browser...
browser started
logging in.
Logged in. allegedly
sorting
loading more
Processing stuff
[<pyppeteer.element_handle.ElementHandle object at 0x7f1d26000640>, <pyppeteer.element_handle.ElementHandle object at 0x7f1d26001030>]
2
Scraped 2 questions(50%)
awaiting browser close
Browser closed
Processing new events...
Sent 0 new webhook messages
Finished, exiting...

from codezinger-due-date-scraper.

RoguedBear avatar RoguedBear commented on July 17, 2024

update:
unable to reproduce the problem when running current version and previous version repeatedly, but --disable-gpu does help in drastically reducing CPU usage.

graph:
image

from codezinger-due-date-scraper.

RoguedBear avatar RoguedBear commented on July 17, 2024

running the program for 2 weeks, commit a64681c does seem to have fixed the issue

from codezinger-due-date-scraper.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.