Some customers takes forever to log in


I have used ASTPP for some years now, recently I received a report from some customers who can’t log in. I looked into it and discovered that some accounts of the system logs in usually, a few seconds and you’re in, but other accounts take minutes to log in and others receive a 504 timeout error and are never or almost never able to log in.

I’ve checked the browser console and Nginx error log and these are the only messages left:

2023/06/26 19:10:32 [error] 1919#0: *19 upstream timed out (110: Connection timed out) while reading response header from upstream, client: CLI.ENT.IP.ADD, server: my.domain, request: "GET /user/user/ HTTP/1.1", upstream: "fastcgi://", host: "my.domain", referrer: "https://my.domain/" GET https://my.domain/user/user/ 504 (Gateway Time-out)

I’ve compared differences among the accounts that can log in and the accounts with the issue but I haven’t found any difference with these accounts that may be causing the delay. No more logs or error messages are available. No MySQL errors or similar. Tried different browsers with the same behavior. I don’t know how to extract more debug from the system or diagnose what’s the cause of the problem.

Any advice is highly appreciated.

This is likely due to the query on the cdrs table taking too long because it has to search back through old records. We just experienced this same problem, and were able to resolve it by adding an index to that table. You can also trim old records beyond a certain date to speed this up. If you want to use the index method instead, execute this from a MySQL shell after selecting the astpp database: ALTER TABLE cdrs ADD INDEX account_date(accountid, callstart);

The bulky db could be the reason. You may check memory utilisation and load average of the server. And indexing on table will work.