API works with larger files on Run, but crashes when deployed on Files larger than 1mb

I made a simple API using flask. It is hosted using gunicorn.

The API takes a document (base64 format), processes it with libreoffice, and returns the edited document.

When I hit the run command on replit and test the API, it works as expected. However, when it is deployed, it only works on smaller docx files - if I try a docx file of ~1.4mb, it typically fails and restarts.

I’ve tried increasing the memory to 16gb and the 8vCPU, and played around with the number of workers, but this hasn’t helped.

Is there anything else that might cause the issue?

1 Like

Would you mind sending a repl link? If you do, we can look at the code and see if there are potential problems.


thanks @python660

Here is the link to the repl: main.py - docx2rtf - Replit

I really appreciate any advice you might have!

1 Like