Multi-Peer Transfers¶
FuryMesh's multi-peer transfer capability allows you to download files from multiple sources simultaneously, dramatically improving transfer speeds and reliability.
Overview¶
Traditional file sharing systems download from a single source, which can be slow and unreliable if that source has limited bandwidth or disconnects. FuryMesh solves this problem by:
- Parallel Downloads: Retrieving different parts of a file from multiple peers at once
- Bandwidth Aggregation: Combining the upload capacity of multiple peers
- Redundancy: Continuing transfers even if some peers disconnect
- Load Balancing: Distributing the transfer load across the network
How It Works¶
Chunk-Based Transfers¶
FuryMesh splits files into fixed-size chunks (typically 1-4MB each), which can be downloaded independently:
- When you request a file, FuryMesh identifies all peers that have the file
- The file's metadata, including the total number of chunks, is retrieved
- FuryMesh begins requesting different chunks from different peers
- As chunks are received, they're verified and stored locally
- Once all chunks are downloaded, they're reassembled into the complete file
Chunk Selection Strategies¶
FuryMesh implements several strategies for deciding which chunks to request from which peers:
- Rarest First: Prioritizes chunks that are available from the fewest peers
- Sequential: Downloads chunks in order (useful for streaming or preview)
- Random: Selects chunks randomly to distribute load
- Adaptive: Dynamically adjusts based on peer performance and availability
The default strategy is "Rarest First," which ensures that rare chunks are downloaded early, improving overall availability in the network.
Peer Selection¶
When multiple peers have the same chunk, FuryMesh selects peers based on:
- Connection Quality: Peers with faster, more stable connections are preferred
- Geographic Proximity: Closer peers often provide lower latency
- Historical Performance: Peers that performed well in past transfers
- Load Distribution: Avoiding overloading any single peer
Performance Benefits¶
Multi-peer transfers provide significant performance advantages:
- Faster Downloads: Speeds can exceed the bandwidth of any single peer
- Better Utilization: Makes use of otherwise idle upload capacity across the network
- Resilience to Slow Peers: Fast peers compensate for slower ones
- Reduced Impact of Disconnections: Other peers continue providing data if one disconnects
Real-World Performance¶
In typical scenarios, multi-peer transfers can achieve:
- 2-5x faster downloads compared to single-peer transfers
- Near-linear scaling with the first 5-10 peers
- Diminishing returns beyond 10-15 peers (due to overhead)
Configuration Options¶
FuryMesh allows customization of multi-peer behavior through several configuration options:
transfer:
max_peers_per_transfer: 10 # Maximum number of peers to use per transfer
min_peers_per_transfer: 2 # Minimum number of peers before starting transfer
chunk_selection_strategy: rarest # Strategy for selecting chunks (rarest, sequential, random)
max_concurrent_chunks: 5 # Maximum chunks to request simultaneously per peer
peer_timeout: 10 # Seconds to wait before considering a peer unresponsive
Usage Examples¶
Command Line¶
To download a file using multi-peer transfer:
API¶
// Request a file from multiple peers
err := fileManager.RequestFileFromMultiplePeers(ctx, fileID)
if err != nil {
log.Fatalf("Failed to request file: %v", err)
}
Monitoring Multi-Peer Transfers¶
FuryMesh provides detailed statistics for monitoring multi-peer transfers:
- Active peers and their contribution
- Per-peer transfer rates
- Chunk availability across peers
- Overall progress and estimated completion time
You can view these statistics through the command-line interface or the web dashboard.
Limitations and Considerations¶
While multi-peer transfers offer significant benefits, there are some considerations:
- Overhead: Managing multiple connections requires additional resources
- Network Constraints: NATs and firewalls may limit the number of simultaneous connections
- Diminishing Returns: Adding more peers eventually yields minimal additional benefit
- Peer Availability: Benefits depend on having multiple peers with the same file
FuryMesh is designed to handle these challenges efficiently, automatically adjusting to provide optimal performance in various network conditions.