Troubleshooting Large scale Exports

Issue: Exports are Incomplete

Multiple large-scale exports (export function is available with Power Add-on ) have been tested on the Store Locator Plus dev site. On a relatively small server, a virtual machine with 2GB RAM running CentOS 6, we  have been able to export 10,000 locations within 15 minutes with no issues. Special characters and extended data have also exported without issue.

If you are experiencing  issues there are several things to check that can cause problems during an export:

Web Server Process Limits

Apache, and nginx as far as I are aware, have per-process limits. This is built into the web server to prevent “runaway” processes that eat up all of the CPU and memory on the server over time. On shared servers this limit is very low and typically allows 30 seconds to 2 minutes of processing time. Large data sets can use up to 5 minutes or more of processing time. Make sure your server has a high enough limit to allow the entire data export to complete execution.

The types of limits that typically impact export:

Process time (CPU cycles used) limitations.
Connection time (how long a single user is connected) limitations.
Memory limitations.
This setting is typically in the httpd.conf file, however there are also system configuration limits for the operating system (rare) and php process limits (more common) that can impact this setting.

PHP Memory Limit

Check the PHP memory limit in your php.ini file.

This determines how much RAM php sessions can consume. While the export is writing to disk there is ongoing overhead to track the process. This should increase marginally as the export data set grows, however there area a number of known memory leaks in PHP that can have a larger impact on some sites depending on which versions of PHP you are using and which extensions you have enabled for PHP. Some PHP installations have no memory leaks and will not exceed the memory limit once the base process has started. Others can exceed the limit after just a few thousand locations. Current WordPress version suggests PHP 7 (as of WP version 4.7.3)

WordPress Memory Limit

WordPress has a wp-config.php file and various define set within the main code that set limits on how much memory can be consumed by a single WordPress session. This will override the PHP memory limits and should be checked. Many larger applications, especially ecommerce applications, require you to edit this setting to change the default value. Store Locator Plus consumes little additional memory per exported location, however the aforementioned memory leaks in some environments can be an problem for this setting.

Operating System Limits

There are various operating system limits that can cause issues including general process limitations, directory security issues, and memory limitation issues. All system-level applications that run on a server are beholden to the over-arching system limitations set by the server administrator. For WordPress sites Apache (or whatever flavor web server app you use) is the primary communicator with the operating system and is most likely to be flagged for “over resource limitations”. PHP can be flagged depending on how you have it configured to work with Apache. Finding server-level limits means search system-level log files.

Less common:

Network Limits

Some firewalls, especially on shared hosting environments, can throttle and time out high bandwidth data streams. This is likely to become more common in the United States with the demise of Net Neutrality. Most hosting companies have stopped this practice.

Browser Limits

Some browsers can try to cache the download file as it streams from the server instead of writing directly to disk. This can cause the browser to run out of memory.

Related Notes

Keep in mind that data is exported in “first in” order. It is not always alphabetical or based on the location ID. It is based on which records were saved to the database first. If you are missing locations on your export it is likely because the export did not complete before being stopped by the server.

There are several factors that work in tandem when dealing with long-running web processes. All of these elements above can cause limitations on exports.
An environment that is properly tuned to deal with large data sets will have no issues with import, exporting, or managing large lists of locations in Store Locator Plus. The core of the product is coded to work well with large data sets with consideration for things like per-event execution time, per-event memory limitations, and reduced disk I/O operations.

The “Debugging WordPress” section on the main Troubleshooting page can help. Turning on WordPress debug logs can quickly identify and resolve export issues. The web server log files (/var/log/httpd/*log on Apache RHEL servers) is also a good place to find limitation hints.