Skip to content

Improvment/disk streaming - #8

Merged
dev-harsh1998 merged 13 commits into
masterfrom
improvment/disk-streaming
Aug 13, 2025
Merged

Improvment/disk streaming#8
dev-harsh1998 merged 13 commits into
masterfrom
improvment/disk-streaming

Conversation

@dev-harsh1998

Copy link
Copy Markdown
Owner

No description provided.

YogeshNimangre and others added 13 commits August 14, 2025 04:18
… tests

* Update documentation while at it to reflect current state.

Signed-off-by: Harshit Jain <reach@harsh1998.dev>
- Updated MAX_UPLOAD_RAM_USAGE from 256MB to 128MB
- Uploads > 128MB now use disk-based streaming to limit memory usage
- Updated memory usage tests to reflect new threshold (64MB vs 150MB)
- All tests passing including stress tests and upload integration tests
- Maintains backward compatibility and performance for smaller uploads
- Add RequestBody enum with Memory and File variants for efficient handling
- Implement automatic streaming logic: small uploads in memory, large to disk
- Update upload handlers to work with new RequestBody structure
- Add comprehensive HTTP streaming tests
- Update all test files to use new RequestBody API
- Fix clippy warnings and maintain code quality
- Achieve scalability and resource protection for large uploads
- Rewrite extract_part_data method to use streaming approach instead of loading entire files into memory
- Process multipart data in chunks while maintaining boundary detection capability
- Fix hanging issue with test_multiple_large_files_bash_verification (85MB test case)
- Remove unused STREAM_BUFFER_SIZE constant to fix clippy warnings
- Maintain memory efficiency for large file uploads while preserving all security validations
- All tests pass including the previously hanging bash verification test
- Enhanced create_memory_efficient_part_reader with 64KB chunked processing
- Reduced memory spikes during large file uploads by progressive buffer draining
- Maintained all existing functionality and security validations
- Improved scalability for concurrent large uploads
- All 86 tests passing with clean code quality (fmt + clippy)

Key improvements:
- Process data in 64KB chunks instead of loading entire parts
- Dynamic buffer management with immediate memory release
- Boundary detection optimization with minimal buffer retention
- Early size validation to prevent memory exhaustion

Memory footprint reduced from potentially GB-sized buffers to KB-sized working sets.
- Update Cargo.toml, CLI, and all source files to version 2.5.1
- Update web templates and error pages with new version
- Update all documentation references to reflect v2.5.1
- Update server headers and health endpoints to report 2.5.1
- Update INI configuration with direct streaming terminology
- Remove redundant 10GB references, replace with unlimited support
- Update README and docs to reflect direct streaming architecture
- All tests pass and build successful
@dev-harsh1998
dev-harsh1998 merged commit fe56835 into master Aug 13, 2025
10 checks passed
@dev-harsh1998
dev-harsh1998 deleted the improvment/disk-streaming branch August 13, 2025 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants