GithubHelp home page GithubHelp logo

Simple question about serverless-chrome HOT 6 CLOSED

adieuadieu avatar adieuadieu commented on May 18, 2024
Simple question

from serverless-chrome.

Comments (6)

adieuadieu avatar adieuadieu commented on May 18, 2024

Hi @yarikbratashchuk. I'm not sure I understand your question. Chrome binds to port 9222 just like any other program can bind to a port. Lambda doesn't forbid you from creating ports. You should be able to use Go to connect to port 9222 from within a Lambda invocation. However, you won't be able to connect to the port from outside of the Lambda function. Lambda functions do not have a public IP.

from serverless-chrome.

yarikbratashchuk avatar yarikbratashchuk commented on May 18, 2024

@adieuadieu thank u for the answer)
The go client makes get request to http://127.0.0.1:9222/json/new, but gets "context deadline exceeded", that is why i asked, it doesn't work for me for now.
How much memory this lambda probably needs?

from serverless-chrome.

adieuadieu avatar adieuadieu commented on May 18, 2024

Hi @yarikbratashchuk. I'm not familiar with that error message. Is there any more information in the function's CloudWatch logs? I would recommend running the function with at least 1024 MB of memory. I usually use the maximum 1536 MB. Chrome is not.. lightweight.

from serverless-chrome.

yarikbratashchuk avatar yarikbratashchuk commented on May 18, 2024

@adieuadieu, this is what i get when try to test function via aws lambda dashboard:
Get http://localhost:9222/json/new: dial tcp 127.0.0.1:9222: getsockopt: connection refused,
but sometimes i get http://localhost:9222/json/new: dial tcp 127.0.0.1:9222: EOF.

context deadline exceeded means that some time has passed but it didn't get a response from http://127.0.0.1:9222/json/new.
Does headless_shell depends on some js stuff, to work?
Does it matter how i invoke lambda?

What is weird is that max memory used
is only 31 MB. As for me it just can't be enough.
And duration is 5258.77 ms.

Thanks a lot for any thoughts

from serverless-chrome.

adieuadieu avatar adieuadieu commented on May 18, 2024

Hm..

Launch the headless_shell with --disable-gpu --single-process --no-zygote --no-sandbox flags. If you want logging, add --enable-logging --log-level=0 --v=99. Try to capture or log the output from headless_shell to CloudWatch (in JS this is done with console.log.) There's usually some kind of error that gets logged to stdout/stderr by headless_shell if something went wrong.

from serverless-chrome.

yarikbratashchuk avatar yarikbratashchuk commented on May 18, 2024

@adieuadieu, seems like no logs on startup. I'm going to leave my go implementation and use your project.

from serverless-chrome.

Related Issues (20)

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.