---
title: "Fixing File I/O errors during Build"
url: https://phatdev.net/en/docs/sl-migrations/how-to-resolve-file-io-related-build-issues
lang: en
updated: 2026-10-20
alternate:
  vi: https://phatdev.net/docs/sl-migrations/how-to-resolve-file-io-related-build-issues
markdown: https://phatdev.net/en/docs/sl-migrations/how-to-resolve-file-io-related-build-issues.md
---

# Fixing File I/O errors during Build

Part of the doc set: [SL Migrations](https://phatdev.net/en/docs/sl-migrations.md)

> The build is slow or fails with I/O errors.

## File I/O Issues during Build

## Symptoms

- The ARCHIVE build phase runs very slowly
- It fails with "Cannot open file" / "Disk read error"
- The build stops midway (50-80%) and makes no progress
- Server load goes up sharply

## Causes and fixes

### 1. Slow disk

The build has to read hundreds of thousands of files → IOPS matters more than bandwidth. An SSD is many times faster than an HDD. On shared hosting you have no control over this - you can move to a host with SSDs if needed.

### 2. Too many small files

A site with several hundred thousand small image files → metadata IOPS becomes the bottleneck. PHP ZipArchive is very slow with this pattern.

**Fix**:
- Switch to the **DupArchive** engine (default)
- Exclude cache folders with many files:
  - `wp-content/cache/`
  - `wp-content/uploads/cache/`
  - `wp-content/litespeed/`
  - The cache folder of whichever caching plugin you use

### 3. Not enough disk for the tmp folder

The build extracts temporarily into `wp-content/backups-slm/tmp/`. You need free disk >= 2× the site size.

Check the free disk space before building.

### 4. Too many concurrent processes

Web server workers + database queries + the build process → compete for IOPS.

**Fix**: build during off-peak hours. Temporarily turn off other heavy cron jobs while building.

### 5. Files locked by another process

Antivirus, a search indexer or another plugin is locking files → the build skips them and logs a warning.

## PHP tuning

On a server where you can change PHP settings:

```ini
realpath_cache_size = 256K
realpath_cache_ttl = 600
opcache.enable = 1
opcache.memory_consumption = 256
```

## See also

- [Zip engines](https://phatdev.net/en/docs/sl-migrations/how-to-work-with-the-different-zip-engines)
- [Server resources](https://phatdev.net/en/docs/sl-migrations/how-to-manage-server-resources-cpu-memory-disk)
