Hi

on Friday and yesterday, we noticed OSticket had slowed down considerably. One of our agents had run a large report mistakenly extracting all tickets on Friday. We thought at first it was due to that query and on Friday evening, we killed the process in mySQL.

Yesterday a similar thing happened, from 11am the server hit 100% and didn't come down. On looking at the query that is taking up the resources in Azure monitoring, it looks like some huge count type query.
Is this an automated query in OSticket to update stats (dashboard/ticket counts) ?

sample few lines of query

SELECT COUNT(DISTINCT CASE WHEN A2.state = 'closed' AND A1.dept_id IN (19, 20) AND A1.created IS NOT NULL AND A1.est_duedate IS NOT NULL AND A1.staff_id = 50 AND A1.closed IS NOT NULL THEN A1.ticket_id END) AS q71, COUNT(DISTINCT CASE WHEN A2.state IN ('open', 'closed') AND A1.created IS NOT NULL AND A1.est_duedate IS NOT NULL AND A2.state IN ('open', 'closed') AND A1.created IS NOT NULL AND A1.est_duedate IS NOT NULL AND A2.state = 'open' AND A1.created IS NOT NULL AND A1.est_duedate IS NOT NULL AND A1.dept_id IN (19, 20) AND A1.staff_id = 50 AND A3.object_type = 'T' THEN A1.ticket_id END) AS q74, COUNT(DISTINCT CASE WHEN A2.state = 'open' AND A1.dept_id IN (19, 20) AND A1.created IS NOT NULL AND A1.est_duedate IS NOT NULL AND A2.state IN ('open', 'closed') AND A1.created IS NOT NULL......

What do you suggest to resolve. Bounce the server or restart a service ?

thanks

Don't suppose you have anything like Power BI gateway connected that may be running queries automatically, or any cron jobs/scheduled tasks running?

thanks, we have some PowerBI extracts, but they run every hour from 9am. This big query appears to be running at 8.20 then at 14:40. It's completed fine this time.

    thank you, much appreciated. Will give it a go

    Write a Reply...