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

Resource Utilization #589

Open
silvadenisaraujo opened this issue Mar 19, 2024 · 0 comments
Open

Resource Utilization #589

silvadenisaraujo opened this issue Mar 19, 2024 · 0 comments

Comments

@silvadenisaraujo
Copy link

Dear maintainers,

I would like to clarify, maybe, a simple question. For context, we have a container dedicated on running critical to extract css from pages running on a k8s pod behind a HTTP server, I would like to know if every time that a requests arrives does it spin up another window or use the same window open, using the base implementation of critical? We've been seen that the container is consuming all the available resources, the scenario is for tens of thousand requests per minute. Is there any docs on how critical manages penthouse therefore manages puppeteer in headless mode ?

async function getBrowser() {
  return puppeteer.launch({
    args: ['--no-sandbox', '--disable-dev-shm-usage'],
    executablePath: '/usr/bin/chromium',
    headless: true,
  })
}
const { css } = await critical.generate({
    html,
    width,
    height,
    request: {
      method: 'get',
    },
    penthouse: {
      puppeteer: {
        getBrowser,
      },
      blockJSRequests: false,
    },
...

Best,

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

1 participant