My Mautic version is: 4.1.2
My PHP version is: 7.4.27
My Database type and version is: mysql 5.7.35-38-log (mysql) Percona Server
My problem is: Everytime I login I get a 504 gateway timeout issue
These errors are showing in the log: I don’t see any in mautic… but I do see this slow query in the database:
Time: 2022-02-15T00:34:16.422342Z
Schema: mauticdbtwo Last_errno: 0 Killed: 0
Query_time: 10.900411 Lock_time: 0.000243 Rows_sent: 4 Rows_examined: 1608254 Rows_affected: 0 Bytes_sent: 1112
SET timestamp=1644885256;
SELECT ll.event_id,
ll.campaign_id,
ll.trigger_date,
ll.lead_id,
e.name AS event_name,
e.description AS event_description,
c.name AS campaign_name,
c.description AS campaign_description,
ll.metadata,
CONCAT(CONCAT(l.firstname, ’ '), l.lastname) AS lead_name FROM campaign_lead_event_log ll LEFT JOIN campaign_events e ON e.id = ll.event_id LEFT JOIN campaigns c ON c.id = e.campaign_id LEFT JOIN leads l ON l.id = ll.lead_id WHERE (ll.is_scheduled = 1) AND (e.type = ‘email.send’) ORDER BY ll.trigger_date ASC LIMIT 4;
Steps I have tried to fix the problem: I have increase timeout on nginx and php-fpm… but honestly this does not seem like any solution … it is just slow on the first load.