Magento API times out after 60 seconds

Magento API times out after 60 seconds

September 15, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento API times out after 60 seconds

Magento API Timeout: Solving the 60 Second Problem

If you’re facing a timeout issue while using the Magento V2 catalogProductUpdate API method for products linked to hundreds of categories, this guide will help you pinpoint and resolve the problem.

Understanding the Time Limit Issue

Magento’s default API endpoints have built-in time limits to prevent long-running requests from consuming excessive server resources. In your case, the catalogProductUpdate call is likely hitting one of these internal timeouts when dealing with a product linked to 800 categories. Increasing the PHP and MySQL time limits won’t help because Magento’s own API processing has its own restrictions.

Where to Look for Solutions

You’ve already explored increasing various time limits in your Nginx configuration:

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 200;
    types_hash_max_size 2048;
    client_body_timeout 2m;
    client_header_timeout 2m;
    send_timeout 2m;

However, these settings primarily control the server’s response to client requests and don’t directly affect Magento’s API processing. To resolve this issue, we need to look within Magento itself.

Magento’s Internal Timeouts

Magento has a built-in max_execution_time configuration in its php.ini or .htaccess file (depending on your setup). This setting limits the maximum execution time for each PHP script run by the server. The default value is 30 seconds, which could be the root cause of your timeout issue.

To confirm this, you can check if any of these files contain a line like this in your Magento installation:

max_execution_time = 60s

If so, that’s why your API calls are timing out after exactly 60 seconds. Magento is stopping the script execution based on this configured limit.

Increasing max_execution_time

If you find the max_execution_time setting in your PHP configuration, you can increase its value to a higher number to give your API requests more time to complete. However, be cautious when increasing this value, as it could lead to scripts running for too long and consuming excessive resources.

Here’s an example of how to change this setting:

max_execution_time = 120s

This increases the maximum execution time to 120 seconds, which should give you enough time to update products linked to hundreds of categories. Just remember that running scripts for too long can have performance implications on your server.

Optimizing API Calls

Instead of relying solely on increasing max_execution_time, consider optimizing your API calls and the data structures involved:

  1. Break down updates: If possible, break down your product updates into smaller chunks by category or attribute group.
  2. Minimize unnecessary data: Ensure you’re only sending the required data in your API requests to reduce processing overhead.
  3. Use asynchronous processes: For heavy operations like mass updates, consider using a background job system (like Magento’s built-in cron jobs) instead of real-time API calls.

Conclusion

In most cases, when facing Magento API timeouts while updating products, the issue lies in Magento’s own internal max_execution_time setting. Increasing this value can provide a quick solution for your specific problem.

However, keep in mind that this approach should be used as a last resort and with caution. Always aim to optimize your data structures and processes before relying on increased time limits.

For more in-depth guides on optimizing Magento performance, check out our Magento Performance Optimization series at Laravel Company.

Catalog Database API Configuration

Our network