admin管理员组文章数量:1357141
I recently upgraded node-html-to-image npm to 5.0.0 and subsequently installs puppeteer v22. I noticed my render time substantially increased from 3 seconds to 15 seconds. I run the service as an AWS Fargate ECS (ubuntu). Here is my Dockerfile:
FROM node:slim
# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- .pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] / stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*
# Bundle app source
COPY . $HOME_DIR
# Clean up dev files
RUN rm -fr node_modules/*
# install app dependencies
RUN npm install
CMD npm start
I have looked at the puppeteer options and see nothing to reduce the render time since it appears that node-html-to-image sets the headless:shell mode for puppeteer.
Here is the invocation via node-html-to-image:
await nodeHtmlToImage({
output: pngName,
html: Html,
puppeteerArgs: {
executablePath: '/usr/bin/google-chrome-stable',
headless: 'shell',
args: ['--no-sandbox'],
},
content: { imageGov: dataURI }
})
I rolled back to version 2.1.1 of node-html-to-image which installs v2.1.1 of Puppeteer. That combination renders in 3 seconds. v3.0.0 of node-html-to-image uses v15 of Puppeteer and that is where the 5x slowdown occurs
本文标签: Puppeteer v22 much slower than v2Stack Overflow
版权声明:本文标题:Puppeteer v22 much slower than v2 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744073235a2586270.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论