Limiting Resource Usage in Sync Processes for Off-Site Backups on Older Machines

Abstract: Prevent older Ubuntu servers from freezing during off-site backups by limiting rsync CPU and I/O priority with ionice and nice.

Created: 2026-10-14 by
To prevent off-site backups from freezing older Ubuntu Server machines, you must limit the CPU and I/O priority of sync processes using built-in Linux tools like ionice and nice. These utilities allow you to reduce the resource footprint of commands such as rsync, ensuring that critical services remain responsive even when transferring large amounts of data over limited bandwidth. By combining these priority settings with careful exclusion strategies, you can maintain system stability without sacrificing backup integrity or speed.

Understanding Resource Contention on Older Hardware

Older machines often struggle with modern backup loads because they lack the multi-core processing power and RAM headroom found in newer servers. When a backup process runs at full priority, it monopolizes disk input/output (I/O) operations and CPU cycles. This contention leads to increased latency for other applications, potentially causing database timeouts, web server drops, or general system unresponsiveness. The goal is not to stop the backup but to make it polite, allowing other processes to run concurrently with minimal impact. The primary resources to manage are disk I/O and CPU time. Disk I/O is often the bottleneck during large file transfers, especially if the destination is a network drive or an external USB device. CPU usage becomes critical when compression is enabled, as compressing data requires significant processing power. By lowering the priority of these tasks, you ensure that the most important system functions take precedence during peak usage hours.

Using ionice for I/O Priority Management

The ionice command allows you to set the I/O scheduling class and priority for a specific process. This is particularly effective for rsync, which generates heavy read and write operations. There are three classes of I/O scheduling: real-time, best-effort, and idle. For backup tasks on older hardware, the "idle" class is usually the safest choice. Processes in this class only perform I/O when no other process needs the disk. You can apply ionice by prefixing your backup command. For example, to run rsync with idle I/O priority, you would use the following structure:
ionice -c 3 rsync -avz /source/ user@remote:/destination/
Here, -c 3 specifies the idle class. This ensures that your backup will not interfere with active database writes or web traffic. If you find that the backup is too slow with the idle class, you might switch to -c 2 (best-effort) with a lower priority level, such as -n 7. However, for older machines, sticking to class 3 is generally recommended to avoid stalling the system.

Applying nice for CPU Priority Control

While ionice handles disk access, the nice command controls CPU scheduling. Backup processes that involve compression, such as those using gzip or bzip2 flags in rsync, consume significant CPU cycles. Using nice lowers the priority of the process, making it yield CPU time to higher-priority tasks. The range for nice values is typically from -20 (highest priority) to 19 (lowest priority). Combining both tools gives you comprehensive control. You can nest them or apply them sequentially. A robust command line for a resource-conscious backup looks like this:
ionice -c 3 nice -n 19 rsync -avz --compress /source/ user@remote:/destination/
This command sets the I/O to idle and the CPU to the lowest possible priority. The --compress flag is included here to demonstrate CPU usage, but note that on very old CPUs, compression might be slower than sending uncompressed data. In such cases, removing --compress reduces CPU load further, though it increases network bandwidth usage. Always test whether compression saves more time than it costs in CPU cycles on your specific hardware.

Optimizing Exclusions to Reduce Load

Reducing the volume of data transferred directly lowers resource consumption. Before worrying about priorities, ensure you are not backing up unnecessary files. Large log files, temporary caches, and virtual machine images can drastically increase I/O and CPU load. Using exclusion patterns helps minimize the workload. For instance, if you are backing up a web server, you likely do not need to back up the /tmp directory or browser cache folders. You can specify exclusions in your rsync command using the --exclude flag. Consider reviewing our guide on excluding large subdirectories from daily backups to understand how targeted exclusions can significantly reduce transfer times and resource usage. Additionally, checking creating backups and snapshots in Linux may provide alternative methods that are inherently lighter on resources, such as block-level snapshots which do not require reading every file individually. By carefully selecting what to exclude, you reduce the total number of files processed, which lessens the strain on both the filesystem cache and the network interface. This proactive approach complements the reactive measures of ionice and nice, creating a layered strategy for resource management.

Scheduling and Monitoring

Finally, schedule these low-priority backups during off-peak hours using cron. Even with low priorities, running backups during business hours can cause subtle performance degradation. Use monitoring tools to verify that your backup jobs are respecting the assigned limits. You can check the current I/O and CPU priority of a running process using ps with appropriate formatting options. Regularly reviewing these metrics ensures that your configuration remains effective as software updates change default behaviors.

Frequently Asked Questions

What happens if I use ionice class 1 instead of 3?

Class 1 is real-time priority, which can starve other processes of disk access and crash the system. It should never be used for background backups. Class 3 is safe because it yields to all other I/O requests.

Can I combine ionice and nice in a single cron job?

Yes, you can nest them in your crontab entry. Just ensure the order is correct, typically applying ionice first, then nice, then the actual command. This guarantees both I/O and CPU constraints are enforced simultaneously.

Does using nice affect the speed of the backup?

Yes, it will likely make the backup slower because the process yields CPU time to other tasks. However, this trade-off is necessary to keep the server usable for other users and services during the backup window.

How do I verify that ionice is working correctly?

You can check the I/O scheduling class of a running process by looking at its status in /proc/[pid]/stat or using tools like iostat alongside ps. The third column in the stat file indicates the scheduling class.

Should I exclude swap files from backups?

Yes, swap files contain volatile memory data and are useless for restoration. Excluding them saves significant I/O and storage space. They are also frequently changing, which adds unnecessary load to the sync process.

Is rsync idempotent when using low priority settings?

Yes, the idempotency of rsync is independent of its priority settings. Whether you use ionice or not, rsync will only transfer changed blocks, ensuring consistent results regardless of speed variations. See is rsync idempotent for more details on this behavior.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More