payload icon indicating copy to clipboard operation
payload copied to clipboard

plugin-cloud-storage: OOMKill Error with GCS Adapter when Uploading Large Files (> 2GB) in Production

Open beewhoo opened this issue 2 years ago • 6 comments

When using the GCS (Google Cloud Storage) adapter in our production environment, we are experiencing Out-of-Memory (OOM) kill errors when attempting to upload large files greater than 2GB. Our server has 2GB of RAM, and it seems that the GCS adapter is not handling memory efficiently for such large file uploads.

It appears that similar issues with large file uploads and memory management have been addressed for the S3 adapter in issue payloadcms/plugin-cloud-storage#37 and the Azure adapter in issue payloadcms/plugin-cloud-storage#46. However, the GCS adapter does not seem to have a corresponding fix or enhancement for this specific problem.

Kindly request assistance from the development team to investigate and address this issue with the GCS adapter. It is causing disruptions in our production environment and preventing us from successfully uploading files larger than 2GB.

@denolfe @DanRibbens

beewhoo avatar Jun 27 '23 15:06 beewhoo

Thanks for the report @beewhoo . I'll need to do some digging on what's available with GCP for streaming from disk without loading the file into memory.

denolfe avatar Jun 28 '23 12:06 denolfe

@denolfe have you had a chance to look at this yet? We're very interested as this is the most memory-hungry part of our app right now.

josephjorgensen avatar Jul 21 '23 18:07 josephjorgensen

I have not had a chance, but this does seem possible according to the example here. Open to accepting a PR.

denolfe avatar Jul 21 '23 19:07 denolfe

@josephjorgensen Thought about this a bit more. Where are you deploying this? Do you have the ability to write to disk? A half-measure may also be to support the useTempFiles option like the others.

Let me know your thoughts.

denolfe avatar Jul 21 '23 20:07 denolfe

@josephjorgensen Thought about this a bit more. Where are you deploying this? Do you have the ability to write to disk? A half-measure may also be to support the useTempFiles option like the others.

Let me know your thoughts.

We're deploying via Render.com. I can look into the useTempFiles option and the pipe example your linked to above, those seem like good options.

josephjorgensen avatar Jul 25 '23 14:07 josephjorgensen

This plugin is now being maintained in the Packages Directory of the Payload Monorepo. This repo will soon be archived and all open issues will be closed. This issue, however, will be transferred over.

paulpopus avatar Jan 16 '24 20:01 paulpopus

This issue was automatically closed due to lack of activity. If this issue is still relevant against the latest codebase, please create a new issue.

github-actions[bot] avatar Dec 06 '24 15:12 github-actions[bot]

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.

github-actions[bot] avatar Dec 08 '24 04:12 github-actions[bot]