dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

Timedout error and crazy behaviour

Open leafarenuk opened this issue 1 year ago • 0 comments

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?

leafarenuk avatar Feb 15 '24 18:02 leafarenuk