Calendar optimization

Situation
I have noticed the calendar is slowing down over time. As much as 10 - 20 seconds to change from one day to another or to change views. This is happening in both my production as well as dev (which is a mirror of prod). I cannot find anything specifically in the logs or in the database that would give me a direction to optimize these queries. I did clear the smarty cache a few times to see if that would help.

Any pointers on where to troubleshoot?

OpenEMR Version
I’m using OpenEMR version 6.1

Browser:
I’m using: Edge, Chrome, Firefox (latest on all)

Operating System
I’m using: Windows 10 and Ubuntu 20

Logs
Did you check the logs?
Was there anything pertinent in them?
Please paste them here (surround with three backticks (```) for readability.
You can also turn on User Debugging under Administration->Globals->Logging User Debugging Options=>All

Hi @KenSchae
I don’t know that this specifically addresses your problem, but when we configure a customer’s calendar we have them only set the categories (In Office, Lunch, etc) for a year at a time. Any change made to the calendar puts a load on the server to check each date that has been configured. If you have a lot of users on the calendar, and the calendar configured for several years into the future this could be what you’re seeing.

I have never revised a calendar config to a shorter duration so don’t know what the effects could be. You might try it on one of the openemr.org demos first.
Good luck- Harley

1 Like

That certainly gives me a direction to look in. Thanks.

your openemr server is running on ubuntu 20?

The Dev box is 20.04. Is that an issue?

Hi Ken,
Do you know how to profile an application? I use PHPStorm but I believe VS also supports.
I don’t have enough test data for calendar to properly profile.
Last time I profiled openemr I found the biggest offender to slow loading was session writes holding scripts open unnecessarily.
Brady and I put in fixes back in v6 however, we may have missed some in calendar.
Also, do you use recurring appointments a lot?

1 Like

We are a psychotherapy practice, we make heavy use of recurring appointments. This angle had not occurred to me (It should have).

I use VS Code but it has the same capabilities as JetBrains. I’ll work on that this weekend.

Follow up to this question. I have been able to observe some things that may point me to the root cause.

  1. One provider is on a Windows 11 laptop using Edge and her calendar view performs great.
  2. Everyone else is on a Windows 10 client using Edge and the calendars are slow.
  3. I cleared cache and cookies on a Windows 10 client and saw some improvement to performance.
  4. I noticed a new javascript error on a user’s machine:

TypeError: timeSlot.attr(…) is undefined
URL: https://{ouropenemrsite}/library
/js/calendarDirectSelect.js
Line: 28 Column: 23
Error object: “{}”

It seems like I am looking at a client-side issue. Any ideas?

The difference between Win10 and Win11 I wouldn’t expect to be an issue however the Edge versions would be different.
I’m not sure what Edge version Microsoft fully implemented using the Chrome engine but it may have been somewhere during Windows 10 updates but for sure Windows 11 Edge is using Chrome engine.
So, I’d expect calendar would preform as well on newer Chrome versions.

Not too concerning but be nice to fix.

Hi Ken, I hope you found your answer. I am just putting this here in case someone else comes across this question. Here is another thing to keep an eye on. I noticed a heavy slowdown when " Audit log SELECT query" and/or “Audit CDR Engine Queries” are active. (Admin> Globals > Logging). If you don’t need to log those, just deactivate those options. The slowdown was most noticeable on the Calendar and the Patient’s Dashboard.