Hi there,
I’m trying to deploy a cloud function with Python using the python-opencv library, however I am getting a 413: Payload Too Large error. I read the documentation and it seems like DigitalOcean only supports a build of 48MB.
Is there anyway to increase this size limit? I know other services like AWS Lambda support up to 200mb.
If not, does anyone have a similar experience of trying to deploy a python function with large requirements? I tried building from the source rather than through pip but it just fails.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Indeed the maximum size of the built function is 48 MB. Basically, everything under <package-name>/<function-name>/ is gathered into a single zip file. The final file needs to be within the 48 MB size limit.
You could try using a .ignore file to ignore any artifacts that you don’t need in order to reduce the overall file size:
Every
<package-name>/<function-name>/folder may contain a.ignorefile. This file uses the same format as.gitignore. It specifies artifacts that should not be a part of the deployed function.
https://docs.digitalocean.com/products/functions/reference/build-process/
Is your project open-source? If so feel free to share a link here and I could have a look and see if there is a way to reduce the size.
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.