Article Overview
- Category: Server Performance, Memory Management & Stability
- Audience: DevOps Engineers, Web Hosts, Store Owners & Technical Support
- Applies To: NextGen Smart Data Importer (Community Free & Enterprise Pro Editions)
- Purpose: Definitive diagnostic and resolution guide for eliminating PHP Out-Of-Memory (
Allowed memory size exhausted) errors, HTTP 504 Gateway Timeouts, and Nginx/Apache process kills during large catalog imports.
1. Executive Summary
When importing thousands of products or posts, standard WordPress importers frequently crash with two common errors:
- Fatal Error: Allowed memory size exhausted (OOM): Occurs when PHP exceeds its assigned memory ceiling (
128MBor256MB). - HTTP 504 Gateway Timeout / 502 Bad Gateway: Occurs when Nginx, Cloudflare, or Apache cuts off a long-running PHP worker that exceeded execution limits (typically
30or60seconds).
NextGen Smart Data Importer is engineered from the ground up to prevent both crashes using Atomic Batch Slicing, an automated Intelligent OOM Shield, and Asynchronous Background Processing.
2. The 2 Primary Failure Modes & NextGen Solutions
3. How to Resolve Memory & Timeout Errors in NextGen
Fix 1: Adjust the Batch Slice Size in Step 3
If your server has a low PHP max_execution_time (e.g. 30 seconds on GoDaddy or Bluehost):
- In Step 3 (Import Settings), locate Batch Slice Size.
- Reduce the batch size from
25down to10or15rows per chunk. - Each AJAX slice will finish in under 3 seconds, well below any host timeout limit.
Fix 2: Configure the Query Buffer Flush Threshold
For servers with strict memory limits (128M):
- Navigate to NextGen Importer ➔ Global Settings ➔ Performance.
- Ensure Intelligent OOM Shield is toggled ON.
- Set Query Buffer Flush Threshold to
250or500queries. - NextGen flushes WordPress's internal query log memory before RAM accumulates.
Fix 3: Switch to Asynchronous Media Downloads (Pro)
If your spreadsheet contains large, high-resolution images (5 MB+ each):
- In Step 3, enable Download Images Asynchronously.
- NextGen creates product posts instantly and delegates heavy image downloading and thumbnail cropping to background cron micro-workers.
- Import speed increases by up to 50x, eliminating HTTP socket wait times.
4. Server Configuration Cheat Sheet (PHP & Nginx)
If you manage your own VPS (DigitalOcean, Linode, AWS EC2, Cloudways), apply these optimal production settings:
; php.ini recommendations for enterprise imports
memory_limit = 512M
max_execution_time = 300
upload_max_filesize = 128M
post_max_size = 128M
max_input_vars = 5000# Nginx proxy timeout configuration
fastcgi_read_timeout 300;
proxy_read_timeout 300;5. Frequently Asked Questions (FAQ)
Q: Does NextGen resume an import if my internet connection drops?
Yes. Because NextGen processes imports in discrete slices and logs session progress to the database, you can reopen the browser, navigate to Recent Imports, and click [ Resume ]. NextGen picks up at the exact row offset where the connection was lost.
Q: Why does my import slow down after processing 10,000 rows?
This is typically caused by third-party plugins (like security scanners or sitemap generators) running heavy overhead per post. In Global Settings ➔ Ecosystems, enable Defer Term Count Updates and Bypass Unnecessary Action Hooks to maintain flat ingestion speed from row 1 to row 100,000.