There is an Adhoc view which gives timeout error. The load balancer is set to timeout any HTTP request at 5 mins. It works fine for an admin user but not for an end user with restricted access.
The query that is produced by the Adhoc View runs for more than 5 mins on the database, for end users with restricted access.
Reduce the amount of data fetched by the Adhoc View by using filters.