This thread is 4 years old. Please do not be a necromancer and start your own thread with your environment details.
A gateway timeout is a pretty generic message which basically boils down to the client did not receive a timely response from a server. This could for a variety of reasons. You would want to look at your [unknown] webserver error logs and see if anything is logged, your PHP error logs to see if there is a time out message, and lastly turn on the MySQL Slow query log and consult them to see if there is a problem being logged there.
Killing zombie thread with a headshot.