Issue: Huge performance issue while opening Tickets page for Agents.
Impact: Tickets page was taking several minutes(mostly over 3 minutes and was sometimes crashing in between too) to load for Agents affecting their productivity. Also even after tickets page was loaded, counts were missing in menu and took another several minutes to load.
This problem statement came to me while working for a Telco Client who were using version 1.14.2. Post fixing this issue, the performance has improved from several minutes to less than couple of seconds.
Bug Found :
While debugging, I found the count of tickets shown in menu doesnt match the count of tickets when tried to export the csv from footer for the selected type of ticket like open, callback etc.
So we had different number of tickets shown on the page with totally different count shown in menu and pagination count thereby making the counts details shown wrong.
Root Cause:
The logic used for getting the count of tickets was doing recursive calls and calling two different functions for the same thing. One of these functions was taking a lot of time doing processing thereby making the tickets page load slower.
Fix :
Instead of two different functions doing the same thing we replaced the call with the function code which was working pretty faster.
File : https://github.com/osTicket/osTicket/blob/develop/include/class.search.php
Line : 993
We replaced the try block functionality with catch block one.
In Tickets page code for getting the pagination count we called basic php count function instead of the code counts function which was an unnecessary call making page processing slower.
Count ajax call on tickets page load.
Post Fix :
- Performance improved from several minutes to less than a couple of seconds.
- Counts on menu and pagination count matched with the number of tickets shown on tickets page
- Counts were loaded on menu on tickets page load in less than few seconds.
Contact Me at https://www.linkedin.com/in/erpriyankagupta/