Getting NGINX 504/timeout and 502/gateway errors during Database restore

Events happening in the community are now at Drupal community events on www.drupal.org.
MacRonin's picture

I am trying to run a Database Restore from a Backup(Backup-Migrate module) but get errors from NGINX before it completes. The backup is rather large (50+meg but cache tables empty) since it is a multi-year blog with multiple updates for many days

Originally I was getting '504 Gateway Time-out / nginx' till I increased 'fastcgi_read_timeout' (in nginx.conf ) from the original 300 to 9000. After that update I now get '502 Bad Gateway / nginx'

The error is coming after approx 5 minutes of execution. Any ideas appreciated.

This is all running on the current release of BOA on a Debian 6/64bit on a Linode 1G box

Comments

Have you tried running the

jtbayly's picture

Have you tried running the BOND.sh script and setting it to dev mode? I was able to get a large import done doing that. I think eventually I did still receive an error page on my browser, but the import finished in the background anyway.

-Joseph

Why not to import that

omega8cc's picture

Why not to import that database dump on command line? It will be much faster. Find the name of the database in the site's settings.php file and then as root run just mysql dbname < dump.sql (backup the site/database first!)

I have same problem about timeouts for tanslation updates, etc

Anonymous's picture

I have some sites with many languages enabled, and keep getting 504 and 502 gateway timeouts when I try to update translations, see a "Status Report" in the admin dashboard, do a database restore, or even when I click on the "Configuration" link in the admin dashboard. This timeout also occurs when I run a l10n-update drush command on the command line interface for the site. On some of the larger sites with 50 enabled languages, this used to take up to 2 hours (web-based or command line) to accomplish - for translation / localization updates suing the drush l10n-update command or via the admin dashboard.

These are for sites in a custom d7 profile with i18n installed in the /data/disk/fast1/static/platforms/platform_name/ directory, so I did the following:

  1. I changed values from 300 seconds to 9000 for fastcgi_send_timeout and fastcgi_read_timeout in http section of /etc/nginx/nginx.conf

I also matched those values in my php.ini script for php-fpm 5.3.

  • that gave me an error trying to restart nginx or php5-fpm, as that was the wong file to make those changes in, seemingly. So I took those changes out of thatf ile and instead added them to : /var/aegir/config/server_master/nginx.conf

That allowed me to obtain a Status Report page, and do a web-based or a terminal based translation update for many, but not all of the sites. For the large sites with 50 languages enabled, I am now getting a 502 gateway timeout error (no more 504 errors) after about 15 minutes, I would guess.

Restoring a db dump via the command line solved that problem for me, but that, too could become a problem as the sites grow.

My questions are:

1.) Is there any security risk or performance loss to setting this high a value for fastcgi_read_timeout and fastcgi_send_timeout,

and

2) What can I change to address the 502 Gateway timeout. Is that a very large header problem, usually?

Thanks for any advice,

Ed

BOA

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: