salopensource / sal

Modular reporting for Endpoints
Apache License 2.0
212 stars 64 forks source link

nginx gives 504 gateway timeout #417

Closed jby closed 3 years ago

jby commented 3 years ago

Describe the bug If I run my docker container without debug, it gives me a 504 gateway timeout when trying to access the main page, wether from login or from within the application. If I run it in debug mode it works as expected, but painfully slow. I am able to access pages within the app if I address them directly in my browser. I.e: http://sal.company.tld/dashboard/1/

To Reproduce Steps to reproduce the behavior: Restart docker container without debug go to main page login timeout after some 50 seconds with error: 504 Gateway Time-out nginx/1.10.3 Expected behavior Promptly being logged in and able to use the app Screenshots See here: https://macadmins.slack.com/archives/C061B9XGS/p1612780384006500

Server (please complete the following information):

Client (please complete the following information):

Additional context I used to run my munki-repo on this host as well as sal in docker - these problems started when I moved the munki-repo and disabled the host-nginx, re-enabling the host-nginx does not solve the problem however. If possible, please replicate the issue while Sal is in debug mode. In debug-mode it runs fine, albeit painfully slow

grahamgilbert commented 3 years ago

As discussed on slack, this is down to server resources. On or more of cpu, memory or disk speed on one or both of your app server or the database. This isn’t an issue with Sal really. You should monitor your resource consumption on both of your app servers and database servers and make changes accordingly. Your hosting platform may even give you insights as to any queries that may be running slowly (such as aws performance insights with rds).

jby commented 3 years ago

This is an on-prem RHEL host running under libvirtd. I'll try to monitor it's resource usage to see if I can find any bottlenecks.

jby commented 3 years ago

So, a summary from my DBA after doing monitoring of the timeout:

I have a hard time to see how the DB is to blame for this.

grahamgilbert commented 3 years ago

As I said on slack, I have no experience with your chosen server platform. I would suggest consulting with a rhel expert for possible causes.

jby commented 3 years ago

I know, but still I want an official record of it.