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

Timedout error and crazy behaviour #62

Open
leafarenuk opened this issue Feb 15, 2024 · 0 comments
Open

Timedout error and crazy behaviour #62

leafarenuk opened this issue Feb 15, 2024 · 0 comments

Comments

@leafarenuk
Copy link

leafarenuk commented Feb 15, 2024

Hi all,
I always run into this error when mutiple people call the pdf.toBuffer() function from https://github.com/westy92/html-pdf-chrome the same time / mutiple API calls are made synchronously to create a pdf..

Error: connect ETIMEDOUT 159.XX.XXX.XXX:9222
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
    at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:130:17)

I use the headless-chrome instance in a docker container on a Hetzner server.
The docker-compose file looks like:

version: "2"
services:
  chrome:
    image: justinribeiro/chrome-headless:latest
    command: ["chromium-browser", "--headless", "--disable-gpu", "--no-sandbox", "--remote-debugging-address=0.0.0.0", "--remote-debugging-port=9222", "--disable-extensions", "--disable-dev-shm-usage", "--disable-features=dbus", "--disable-software-rasterizer"]
    restart: always
    ports:
      - "9222:9222"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://159.XX.XXX.XXX:9222"]
      interval: 10s
      timeout: 5s
      retries: 5
    logging:
      options:
        max-size: "10m"
        max-file: "3"
    mem_limit: 4g 
    cpus: 3.0 

The chrome instance looks like this.
CleanShot 2024-02-15 at 19 09 09@2x

@justinribeiro Is there anything I need to consider?

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