Jonathan Pellerin
Jonathan Pellerin

Reputation: 432

Puppeteer creates a large number of cache files in /tmp when used in Rendertron

We are using Rendertron for Server-side rendering on one of our site and we're having problems with files created by puppeteer.

We have the Rendertron cache set to "memory" with a limit of 500, which seems to work properly. But even with the cache set to memory in Rendertron, the underlying puppeteer processes will create tens of thousands of files under the /tmp/puppeteer_dev_chrome-[profileId]/Default/Cache directory.

This causes problems when there is a lot of requests hitting Rendertron. The disk I/O will quickly reach 100% and then the server will become unresponsive.

We have tried looking into flags we can pass to puppeteer (found here https://peter.sh/experiments/chromium-command-line-switches), but we can't seem to find one (or more) that would fix our problem.

Did anyone ever use rendertron for SSR and had this kind of problem? Any kind of help would be appreciated.

Upvotes: 1

Views: 1634

Answers (1)

Andrei
Andrei

Reputation: 33

I ran into this recently on GCP where our iops were being eaten up on render boxes by /tmp usage, even though we had cache set to memory. Best thing to do is just use your RAM vs storage for the /tmp data by leveraging tmpfs. Here's an example from /etc/fstab for a "secure" 1GB /tmp leveraging tmpfs:

tmpfs /tmp tmpfs mode=1777,nosuid,nodev,size=1g 0 0

Once you have the fstab entry added, just 'mount /tmp', and restart services with any open file handles tied to previous /tmp.

Upvotes: 1

Related Questions