All Products
Search
Document Center

Elastic Compute Service:Resolve the insufficient disk space issue on a Windows instance

Last Updated:Nov 01, 2024

If the disks on Windows Elastic Compute Service (ECS) instances are full or running low on disk space, issues may occur. For example, the operating systems of the Windows ECS instances may slowly run, or the applications hosted on the instances may be unable to run as expected. This topic describes how to resolve the insufficient disk space issue on a Windows ECS instance and provides suggestions on how to maintain disks.

Solutions

This section describes how to resolve the insufficient disk space issue on an ECS instance that runs Windows Server 2019. The operations that you can perform may vary based on the instance operating system.

Method 1: Free up disk space

To resolve the insufficient disk space issue on a Windows instance, you can delete unnecessary files that occupy a large volume of disk space. Perform the following steps:

  1. Identify the files that occupy a large volume of disk space on the Windows instance.

    1. Connect to the Windows instance.

      For more information, see Connect to a Windows instance by using a username and password.

    2. On the Windows desktop, double-click This PC.

    3. Click the disk from which you want to delete unnecessary files and press Ctrl+E.

    4. In the top navigation bar, choose Search > Size and select a system-defined file size range to search for files.

      Note

      You can also specify a custom file size range to search for files. Examples:

      • Enter Size: > 500 MB to search for files that are larger than 500 MB in size.

      • Enter Size: > 100 MB < 500 MB to search for files that are between 100 MB and 500 MB in size.

  2. Delete files that you no longer require.

    We recommend that you use the Windows Disk Cleanup utility to delete unnecessary files and empty the recycle bin.

    1. In the lower part of the desktop, enter Disk Cleanup. In the Disk Cleanup dialog box, select the disk from which you want to delete unnecessary files and click OK.

      The system starts to scan the disk for the files that you can delete. The scanning process may require a period of time to complete.

    2. Select the files that you want to delete based on your business requirements and click OK.

Method 2: Resize the disk that is full or running low on disk space or purchase a new disk

If you cannot delete files from the disk that is full or running low on disk space or you cannot free up sufficient disk space by deleting files, you can resize the disk or purchase a new disk based on your business scenarios and requirements. For more information, see Overview, Create an empty data disk, and Attach a data disk.

Suggestions on routine disk maintenance

Compress files for archiving on a regular basis

Specific files are generated on a regular basis on the disk. You can use a compression tool and configure a file compression policy to compress the files for archiving on a regular basis to improve disk usage. We recommend that you use WinRAR to compress files.

  1. (Conditionally required) If no compression tools are installed on the Windows ECS instance, download and install WinRAR. Download link: WinRAR and RAR archiver downloads.

    In this example, the WinRAR English version is used.

  2. Find the file that you want to compress, right-click the file, and select Add to archive...

  3. Specify the path in which you want to save the archive file and configure other parameters.

    1. In the Archive name and parameters dialog box, click the Backup tab and select Generate archive name by mask. Do not click OK.

    2. Click the General tab and then click Browse to specify the path in which you want to save the archive file. Click Profiles... and select Save current settings to a new profile...

    3. In the Profile parameters dialog box, enter a name in the Profile name field, select Save archive name, Save selected file names, and Create shortcut on Desktop, and then click OK.

    4. In the Archive name and parameters dialog box, click OK.

      A shortcut to the archive file is generated on the desktop.

  4. Configure a file compression policy.

    1. In the Control Panel window, click System and Security. In the Administrative Tools section, click Scheduled tasks. In the Task Scheduler dialog box, click Create Basic Task in the Actions column.

    2. In the Create Basic Task Wizard dialog box, follow the on-screen instructions to configure parameters.

      In the Start a Program step, configure the Program/script parameter. To configure the parameter, click Browse and find and select the previously generated shortcut.

Delete unnecessary applications on a regular basis

You can go to the Programs and Features page in the Control Panel window and uninstall the applications that you no longer require on regular basis to free up system space.

Clear disks on a regular basis

In a distributed application system that consists of multiple Elastic Compute Service (ECS) instances, the applications that are hosted on each ECS instance generate a large number of log files. The number of log files rapidly increases over time, and a large volume of disk space is occupied by the log files. As a result, the disk space may become insufficient, which affects application performance and service stability. You can use CloudOps Orchestration Service (OOS) to configure one or more rules to periodically and automatically batch delete files from disks to maintain sufficient disk space and ensure that the system runs as expected. For more information, see Use OOS to periodically clean up disk space.

Monitor the usage of disks

You can view the usage information of disks, such as the amount of used storage space, disk usage, and inode usage, in the CloudMonitor console. You can also create alert rules for disks in the CloudMonitor console. This way, you can receive alerts when disk usage exceeds a configured threshold and clean up disk space at the earliest opportunity.

For more information, see View the monitoring data of a cloud disk.

Optimize storage to prevent frequent full disk issues

If your disk space is frequently exhausted or the demand for data storage space is rapidly increasing, you can optimize storage based on your business requirements to prevent frequent full disk issues.

  • If your disk stores a large number of files, such as images and videos, and no high-concurrency read or write operations are performed on the disk, you can use Object Storage Service (OSS). OSS is a large-capacity, secure, cost-effective, and highly reliable cloud storage service that can automatically expand storage space based on the volume of data. You can use ossfs to mount OSS buckets to ECS instances. You can manage objects in OSS buckets in the same manner that you manage on-premises files without the need to modify code. For more information, see ossfs.

  • If your business requires high-concurrency read and write operations and data sharing, you can use File Storage NAS to store files. NAS provides simple and scalable file systems that support high-performance and high-concurrency shared storage. You can use NAS together with ECS. NAS can automatically expand the storage space as the volume of data increases without the need for manual operations. For more information, see Mount a file system on a Windows ECS instance.

  • If you store a large number of log files on disks, you can transfer the log files to Simple Log Service. This facilitates log query and reduces disk usage. For more information, see Getting Started.