When thinking about making backups as efficient and timely as possible to decrease backup time windows, our backup solution needs to be as efficient as possible. This would include excluding any files that may be unnecessary to include in backups of VMware or Hyper-V virtual machines and replicas. Nakivo Backup & Replication is a modern backup solution that is able to exclude unnecessary system files such as swap files by default. The results in backup window reduction as well as backup storage and replica space can be dramatic. Let’s take a closer look and see how excluding page file affects VM backup within Nakivo Backup & Replication.
How Excluding Page File Affects VM backup
Before we get into the nuts and bolts of Nakivo Backup & Replication and configuring the skip swap files option, what are swap files used for in virtual machines that are being backed up? Swap files in a Windows OS and swap partitions in Linux are essentially used for the same thing. They are used for “virtual memory” that is used to page out information that is temporary runtime data not stored in RAM. Operating systems will free up RAM that is full using the swap files/partitions so that the faster RAM can be used for higher performance for priority processes.
Swap files/partitions are essential for a healthy running Windows or Linux system. However, the contents of the swap locations are volatile and no purpose is served in retaining these in backups. In fact, we are simply creating longer backup windows for backups to run and using more space for our backups unnecessarily. Can the data contained in the swap files add up across backups? Absolutely. Let’s say we had 20 VMs that had 4 GB worth of used swap data between them and we backed up these VMs for 30 days. We simply have to do the math here.
20 VMs x 4 GB x 20 days = 2.4 TB of unneeded/unusable data!
If we take a look at a sample Windows Server 2012 R2 server that has a system managed page file, we can see the amount of potential data that will unnecessarily be copied.
How do we exclude these swap files from our backups?
Nakivo Backup & Replication does this for you automatically! In fact, the setting to skip swap files is on by
default. This is a global setting found in Nakivo Backup & Replication under the Settings menu >> General >> System settings.
Under the System settings >> Processing Options you will see the checkbox to Skip swap files and partitions during processing. The bubble tip if you hover over the “?” for help explains – “If selected, swap files and partitions will be skipped during backup or replication job processing. This feature allows creating smaller backups.”
Testing the effect of the “skip swap files and partitions” setting
The first thing we want to do is perform a full backup of a server with the “skip swap files and partitions” setting configured. In the resulting Nakivo Backup & Replication backup, as shown, we backed up 52.4 GB worth of data from the Windows Server 2012 R2 server.
What about the same server with the “skip swap files and partitions” setting unchecked? When we run the full backup against the same test virtual machine without skipping the swap file, notice the difference. Backing up the same virtual machine without any change in other data results in 54.3 GB worth of data. This is roughly 2 GB difference between the amount of data copied in the first full backup and the second full backup.
The difference between the two may seem trivial. However, we are only looking at a single virtual machine. What if you have 200 virtual machines that you are backing up and there is a 2 GB difference between backups when not skipping the swap file? When doing the math, we can easily see how quickly the difference this setting makes will add up in terms of storage costs and backup time windows.
What about in memory data used by applications?
You may wonder, what about data in memory that haven’t been written to disk such as with database applications? This is where “app-aware mode” comes into play. With application aware backup and replication jobs, volume shadow copy writers force application data living in memory to be flushed to disk before the backup happens. This allows for applications such as databases applications to maintain transactional consistency. Any servers that run applications that need transactional consistency such as Microsoft SQL Server or Microsoft Exchange should use the app-aware backup mode to consistently backup these applications.
Nakivo Backup & Replication is able to intelligently skip files that hold no value in backup data. The swap files that are found in both Windows as well as Linux virtual machines, represent data that is used to page out data when system physical memory is needed for faster, high priority operations. We can see how excluding page file affects VM backups. By skipping these files and partitions we reap huge dividends in the time it takes for backups and replicas to complete as well as the storage space required to house both. By using application aware backups, any in memory transactional operations are properly flushed to disk before the backup is taken of transaction critical systems such as Microsoft SQL Server and Microsoft Exchange. For the most efficient use of time and storage resources, be sure to utilize the skip swap files and partition setting in Nakivo Backup & Replication.