How to improve the file server's time-consuming problem of deleting large folders

When deleting large folders in the file server, it is often time-consuming. For example, on less fast storage, deleting a folder that contains 100,000 files may take 1 to 3 minutes. If waiting for the deletion result in the original thread synchronously, it will block the running of the original thread. If deleting the folder asynchronously in another thread, while it does not block the operation of the original thread, for those users who pay attention to the deletion result, they still need to wait for the result of asynchronous operation, so from the user's perspective, the deletion operation is still slow.

deleting large folders in the file server,

How to improve this status

Given that the folder in the file server, from a user's perspective, is invisible to the user, it has achieved the effect of being "deleted". Therefore, if we can hide the display of the folder on the premise that the server successfully deletes the file, and then respond to the user's delete request immediately, finally complete the actual deletion operation, then in the eyes of users, the deletion speed of the server has been greatly improved.

As mentioned earlier, we can rename the folder before actually deleting it, adding a specific pending deletion tag (this could be a predetermined string), and then hide the display of the folder with the pending deletion tag on the server side. Contrary to actual deletion operation, folder renaming is very fast, hence in the user's eye, we rapidly deleted the target object. Afterwards, to ensure the folder to be correctly deleted, we can set up a database, record the actual path of the renamed folder, and then actually delete the object in a specific thread.

Measures to Improve Time-Constant Deletion of Large Folders from File Servers by Raysync

Raysync is a file system based on a self-developed Raysync transfer protocol. It provides a secure and efficient file transfer and synchronization solution for users. For the issue of time consumption for users to delete large folders on the server side, Raysync has well practiced the above idea. Its practice is as follows:

 deleting large folders in the file server

Step 1: After receiving the deletion request from the user side, the server side first renames the target folder, adding a specific string starting with .delete as a pending deletion tag.

Step 2: Block the user side display of folders with a pending deletion tag.

Step 3: Respond to the user side deletion request.

Step 4: Record the actual path of the folder to be deleted into a specific database.

Step 5: In dedicated threads, read the database record regularly, completing the actual deletion operation for the folder to be deleted.

Step 6: For each successful folder deletion, delete the corresponding record in the database. For failed deletions, keep the record for the next deletion.

For a folder that contains hundreds of thousands or even millions of files, the Raysync can respond to the user's repair request quickly (usually within 1s) while ensuring the correct deletion of the folder. From a user's perspective, the speed improvement of this completely asynchronous deletion method compared to directly deleting the target folder is significant (from minutes to within 1s).


Deleting large folders on a file server often takes a considerably long time, which impacts the server's performance and efficiency. To address this problem, one can adopt the solution provided by the file transfer software - Raysync. Raysync is renowned for its ultra-high speed and stability, capable of achieving rapid transfer and deletion of large files or folders of several hundred GB or even TB scale.

Share This:

You might also like

Raysync News

November 20, 2022

Join our FREE Webinar NOW!

Raysync is designed with a new data access technology to make sure that the upload speed for your small file transfers can reach up to 4,981 files per second and a download speed of 5293 files per second!!

Read more

Raysync News

May 5, 2022

Everything You Need to Know About File Transfer Protocol

File Transfer Protocol (FTP) is a widely used network protocol for transferring files between computers over a TCP/IP-based network (such as the Internet).

Read more

Raysync News

July 14, 2020

How to Avoid the Security Risks of Inefficiency with File Transfer Solution?

The common ways individuals and organizations move data from point A to point B include email, FTP, HTTP, consumer file sharing applications, or even the physical delivery of a USB drive or paper files and documents.

Read more

We use cookies and similar technologies to collect information about how you interact with our website and allow us to remember you. We use this information in order to improve and customize your browsing experience and for analytics and metrics about our visitors both on this website and other media. To find out more about the cookies we use, see our Cookie Policy & Privacy.

If you decline, your information won’t be tracked when you visit this website. A single cookie will be used in your browser to remember your preference not to be tracked.