Configuring an Rsync server
Rsync is a fast and efficient file transfer protocol that uses delta-transfer algorithm to minimize data transfer. It is ideal for deployments where you want to optimize bandwidth usage and transfer speed.
Requirements
Rsync servers require SSH key authentication. Password-based authentication is not supported with the Rsync protocol.
Configuration
Enter the hostname of your server, then enter the port your server is listening on. If you haven't changed this, the default port 22 will be used automatically.
Enter your username for the server. Since Rsync requires SSH key authentication, you will need to add your project's public key to the server.
SSH Key Setup
You can find the appropriate public key to add to the authorized_keys file on your server by clicking the link shown in the server configuration page.
Once you've copied the key, login to your server as the same user that you're configuring in DeployHQ. The easiest way to do this is via a terminal.
Once you've logged in, you can run the following commands:
cd ~/.ssh/
nano authorized_keys
Then, paste the key into the file as a new line, with no trailing spaces. Then, press Ctrl+X, then y, then hit enter to save your key.
Advanced Features
Rsync servers support all advanced deployment features including:
- Zero downtime deployments (atomic deployments)
- Accelerated transfers (turbo deployments)
- Unlink before upload option
- Single connection mode for improved performance
- SSH commands and build commands
Single Connection Mode
Single connection mode is an optional performance optimization that batches file transfers into fewer SSH connections. This feature is particularly beneficial for hosting providers that rate-limit SSH connection attempts.
How It Works
In traditional mode, each file in your deployment creates a separate rsync process and SSH connection. For a deployment with 500 files, this results in 500 individual SSH connections, which can trigger rate limiting on some hosting providers.
When single connection mode is enabled, DeployHQ batches multiple files into fewer rsync commands using rsync's file-from feature:
- Deployments with fewer than 500 files use a single rsync command
- Larger deployments are automatically batched into groups of 100 files per command
Performance Characteristics
Single connection mode provides significant benefits:
- Reduced SSH connection overhead
- Faster deployment times on rate-limited hosts
- Lower server resource usage
- Improved reliability with connection-sensitive hosting providers
For example, a 500-file deployment reduces from 500 SSH connections to just 5 connections (100 files per batch).
When to Enable Single Connection Mode
Enable this feature when:
- Deploying to WP Engine or other hosting providers that rate-limit SSH connections
- Experiencing slow deployments due to connection overhead
- Your hosting provider reports excessive connection attempts
- You want to optimize deployment performance for large file counts
- You are not using Turbo Deployments (which already provides optimal connection efficiency)
Configuration
To enable single connection mode:
- Navigate to your project's server configuration
- Select your Rsync server
- Check the "Use single connection mode" option
- Save your server configuration
Once enabled, all deployments to that server will automatically use batched file transfers. If batching fails for any reason, DeployHQ automatically falls back to traditional per-file transfer mode.
Compatibility
Single connection mode is fully compatible with all other Rsync features including:
- Atomic deployments
- Unlink before upload
- SSH commands and build commands
- Custom deployment paths
Note: When Turbo Deployments (Accelerated transfers) is enabled, it takes priority over single connection mode. Turbo Deployments already uses the most efficient connection strategy, transferring all files through a single optimized rsync operation. Single connection mode only applies to standard rsync deployments.
When to Use Rsync
Rsync is particularly useful when:
- You need efficient bandwidth usage for large deployments
- You want faster transfer speeds for incremental changes
- You are deploying to hosting providers that have SFTP restrictions (such as WP Engine)
- You need zero downtime deployments on platforms with limited SFTP support
For more information about using Rsync for zero downtime deployments on WP Engine, see Zero downtime deployments on WP Engine.