Uploading files greater then 500MB to storage fails
- Dominant language
- TypeScript
- Stars
- 57.4k
- Forks
- 5.7k
- Avg merge
- 14h 50m
- Merged PRs (30d)
- 276
Description
### 👟 Reproduction steps
1. Create a new bucket in an empty project
2. Select create file
3. Attempt to upload a file that is over 500MB (750MB-1GB seems to trigger consistently, sometimes ~500MB goes through)
- **NOTE:** Sometimes the first upload will go through but further attempts fail, even after restart of the server
- I have also attempted this with local and S3 storage with similar results in both cases
- Attempted to upload files of size 578.9MB and 1.3GB for testing
### 👍 Expected behavior
File uploads successfully
### 👎 Actual Behavior
File uploads fails with the following error in the appwrite pod if using S3 storage method:
```
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 5242880 bytes) in /usr/src/code/vendor/utopia-php/storage/src/Storage/Device/S3.php on line 228
[2026-06-22 05:14:27 *18.9] ERROR php_swoole_server_rshutdown() (ERRNO 503): Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 5242880 bytes) in /usr/src/code/vendor/utopia-php/storage/src/Storage/Device/S3.php on line 228
[2026-06-22 05:14:27 $7.0] WARNING Worker::report_error(): worker(pid=18, id=9) abnormal exit, status=255, signal=0
```
The same error occurs for local storage method but in `/usr/src/code/vendor/utopia-php/storage/src/Storage/Device/Local.php`
### 🎲 Appwrite version
Different version (specify in environment)
### 💻 Operating system
Linux
### 🧱 Your Environment
- Windows Desktop Dev Environment
- Appwrite 1.9.0 running through Docker Desktop using WSL
- 64GB or ram with at least 32GB available during tests
- Attempted with forced allocation of 16GB through deployment section
- Digital Ocean Appwrite Marketplace Server 1
- Appwrite 1.9.0 running through docker
- Basic Shared CPU instance with 2vCPU and 4GB of ram
- Free ram was between 700-450MB during uploads
- Digital Ocean Appwrite Marketplace Server 2
- Appwrite 1.9.0 running through docker
- Basic Shared CPU instance with 8vCPU and 16GB of ram
- Free ram stayed above 12GB during uploads
- All environments used the same .env with only the domain changed
- GCP Storage was used for testing the S3 storage method
### 👀 Have you spent some time to check if this issue has been raised before?
- [x] I checked and didn't find similar issue
### 🏢 Have you read the Code of Conduct?
- [x] I have read the [Code of Conduct](https://github.com/appwrite/.github/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Research direction
Start by inspecting vendor/utopia-php/storage/src/Storage/Device/S3.php at line 228 and the corresponding upload path in Device/Local.php. Reproduce the failure with the documented 578.9MB or 1.3GB files in the Appwrite 1.9.0 Docker setup, then verify that local and S3 uploads complete without exhausting PHP memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100