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

Disable --single-process option #15

Open
alekseykulikov opened this issue May 15, 2017 · 6 comments
Open

Disable --single-process option #15

alekseykulikov opened this issue May 15, 2017 · 6 comments
Assignees

Comments

@alekseykulikov
Copy link

alekseykulikov commented May 15, 2017

Hey, thank you for great work on compiling chrome for Lambda.

I'm trying to run perf audits, but it seems --single-process option, breaks performance metrics significantly.

No --single-process:
image

With --single-process:
image

Could you explain, why there's --single-process option and how to avoid it? I've tried to run without it, but in this case http://127.0.0.1:9222/json returns empty value and chrome just does not work.

@adieuadieu
Copy link
Owner

Hi @alekseykulikov,

I apologise for my brief reply. In short: I don't really know.

I haven't had a chance to dig into it much myself—but, like you've discovered, headless Chrome doesn't run correctly without the --single-process flag when running within the Lambda environment and running in single-process mode breaks or disables some reporting. For example, Chrome will log to stderr Started multiple compositor clients (Browser, Renderer) in one process. Some metrics will be disabled. when started with --single-process—these may be the metrics tools like Lighthouse rely on for some of their reporting.

My best guess is that it has something to do with the sandboxing of Chrome and it's processes. It's possible that there may also be a bug in headless Chrome itself. In the Lambda environment, AWS has things pretty restricted and I suspect some combination of things Chrome is trying to do to isolate / restrict the different layers of processes relies on Linux OS features which aren't available within Lambda. For example, if you listen to stderr on the spawned chrome process, without --single-process, Chrome will log a lot of prctl(PR_SET_NO_NEW_PRIVS) failed errors. This may be keeping Chrome from starting a separate process for a browser tab.

I'll raise this issue on the headless-dev group and follow up here with any news.

@alekseykulikov
Copy link
Author

Thank you very much @adieuadieu for detailed reply!
Yes, let's see in headless-dev group, maybe some prevention of prctl(PR_SET_NO_NEW_PRIVS) failed will allow to start a browser tab.
I've also found, that without --no-sandbox option, chrome does not start at all.

@adieuadieu
Copy link
Owner

I've asked about --single-process and --no-sandbox here.

@bluepeter
Copy link

This is a bit late: but anyone have any update on running Lighthouse via headless Chrome on Lambda? Try as we can, we can't get it working without due to the need for --single-process requirement.

@miroljub1995
Copy link

miroljub1995 commented Mar 17, 2023

Did someone manage to run it without --single-process on lambda?

@iamkhalidbashir
Copy link

I am looking for the solution too

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

5 participants