Title: Gateway Timeout 504
Last modified: August 31, 2016

---

# Gateway Timeout 504

 *  Resolved [3Lancer](https://wordpress.org/support/users/3lancer/)
 * (@3lancer)
 * [10 years ago](https://wordpress.org/support/topic/gateway-timeout-504/)
 * Hi,
 * This plugin works fine, until you get to an extremely large database.
 * Testing with 200,000 user accounts, orders, etc.
 * I get a ‘Gateway Timeout – 504 error’, I believe this is due to PHP Timeout? 
   Would there be any solutions limiting the amount processed at a single time or
   do I have to increase the timeout via server side?
 * [https://wordpress.org/plugins/rvg-optimize-database/](https://wordpress.org/plugins/rvg-optimize-database/)

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [cageehv](https://wordpress.org/support/users/cageehv/)
 * (@cageehv)
 * [10 years ago](https://wordpress.org/support/topic/gateway-timeout-504/#post-7404518)
 * Hey 3Lancer,
 * Yes, sounds like a PHP-timeout (which is 30 seconds per default)…
 * For testing, you could put the following line of code at the beginning of my 
   main plugin file (rvg-optimize-database.php):
 *     ```
       /********************************************************************************************
        *
        *	MAIN CLASS
        *
        ********************************************************************************************/
       set_time_limit ( 4 * 3600 );
   
       // CREATE INSTANCE
       global $odb_class;
       $odb_class = new OptimizeDatabase();
       ```
   
 * If that works your provider should increase the time limit on the server.
 * peace,
    Rolf

Viewing 1 replies (of 1 total)

The topic ‘Gateway Timeout 504’ is closed to new replies.

 * ![](https://ps.w.org/rvg-optimize-database/assets/icon-256x256.png?rev=3350597)
 * [Optimize Database after Deleting Revisions](https://wordpress.org/plugins/rvg-optimize-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rvg-optimize-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rvg-optimize-database/)
 * [Active Topics](https://wordpress.org/support/plugin/rvg-optimize-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rvg-optimize-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rvg-optimize-database/reviews/)

## Tags

 * [timeout](https://wordpress.org/support/topic-tag/timeout/)

 * 1 reply
 * 2 participants
 * Last reply from: [cageehv](https://wordpress.org/support/users/cageehv/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/gateway-timeout-504/#post-7404518)
 * Status: resolved