question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optimum k8s node-worker resource limits for Lighthouse running w/ headless chrome in a container?

See original GitHub issue

Hi there! 👋

We are seeing large gaps in our Lighthouse performance scores when running Lighthouse v2 (via CLI) in a container using headless chrome vs running Lighthouse locally in our browser. In both scenarios, and running against the same URL, the containerized solution with headless chrome gives significant drops in performance scores.

Our deployed image has headless chrome installed and then we use the chrome-launcher + lighthouse NPM packages in our testing application to run Lighthouse tests against all our urls.

We use Kubernetes and deploy our testing application as a cronjob. In k8s we have a dedicated node-pool to which we deploy our above lighthouse testing application. Each worker in the pool uses the n1-standard-2 (2 vCPUs, 7.5 GB memory) machine type. When running our tests we try to run 8 jobs in parallel (basically 8 node-workers each running lighthouse tests against different urls)

We deploy our application as a cronjob in k8s to the dedicated node-pool using the following resource limit settings:

  resources:
    requests:
      cpu: 1000m
      memory: 4Gi

These resource settings give us reasonable performance score results, but still significantly lower scores than running Lighthouse locally in our browser against the same URL.

Would it please be possible to get some recommended settings which would help us achieve parity in our containerized lighthouse performance scores vs running lighthouse locally? Given Chrome is heavily multi-threaded would it make sense to try bumping the cpu request limit to 2000m?

Such a change would also force us to upgrade our node-pool workers to the next step up machine type - n1-standard-4 (4 vCPUs, 15 GB memory) I think, but it’s something we’re willing to invest in if it helps us achieve the parity we’re looking for!

Any input and/or advice would greatly be appreciated from the Lighthouse/Chrome team! Please also let us know if there are any possible follow up questions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
patrickhulcecommented, May 22, 2018

A little confused that you would suggest we reduce CPU and disable throttling. Is the goal not to emulate a Nexus 5 on 3G? Maybe there should be a warning when LH cannot properly emulate these conditions.

That is definitely the goal, but in cases where the CPU you’re running on is closer to a Nexus 5X than a desktop, then the throttling we apply is overkill. What I’m essentially suggesting is that you manage the CPU throttling yourself in k8s by limiting the available CPU resources and tell Lighthouse to disable the throttling because you’re already throttling outside of Lighthouse. Does that make sense?

1reaction
githubjoshcommented, May 23, 2018

got it. seems reasonable. many thanks @patrickhulce. will give it a go and report back. @skalfyfan

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crafting the perfect container to play with a Headless Chrome
With 28 contributors, I have been working on this project to create the perfect image to run Chromium in Headless mode:.
Read more >
Lighthouse Scanner: Deploying with Kubernetes - Admantium
Lighthouse is a service to scan webpages and see how good they score on terms of SEO, performance and best practices.
Read more >
Debian -- Prospective packages
Provides RESTful resource routing., 1650 days in preparation. ... 2D vector arcade game with 50 levels., 801 days in preparation.
Read more >
Bookmarks - Software Engineer - Simone Corsi
Bookmarks. This is a collection of all the repositories I've starred over the time! The list is automatically updated every night!
Read more >
Running Headless Chrome with Puppeteer and Docker
to build the images and bring up the container. By default, the containers run in the foreground, so you'll need to switch to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found