openEMR 7.0.2 extremely slow

Hello again @sjpadgett and @stephenwaite . I still couldn’t do the installations from scratch. But I wanted to reinforce 2 situations. 1 it gets extremely slower when we use the system from 2 different offices over the internet. 2 If I copy the openemr 6 directory and use it with the 7.0.2 base, it works very quickly, this makes me think that the problem is not in the database, but in the programming of some openemr 7.0.2.

Obviously working in the same situation, this did not happen with openemr 6.0.0

regards

7.0.2 introduced many more uuids to the database and believe that is the difference you’re experiencing

And how can I improve it so that it has the performance it had before? What do uuids really do?

you have to try to optimize your xampp db, thought that would be easiest by tweaking innodb settings

uuids are used for the FHIR rest apis and the plan is for eventually allowing OpenEMR to run offline and by synchronized back into the system.

When your system is being slow (such as in the flowboard) you can run the following query in PHP MyAdmin (or from the mysql client);

SHOW FULL PROCESSLIST;

That will likely give some clues on what queries are being problematic for you. You should be able to paste a couple of those (you may have to run the command a couple of times if there are multiple queries) and that can give us a bit more insight into what is going on.

You could also turn on the mysql slow query log but that’s a bit more advanced.

Edit*
I’ll just mention that the queries will help us to identify if there is a part of the new codebase that is writing queries inefficiently or needs to be optimized or if it is truly something at the db level.

1 Like

Hi everyone,
I’ve verified a huge difference in Flow Board loading between v6.0.0 and latest!
Same search between the two is 8.5 to less than 2 seconds!
So @mlobo4370 Sorry but we should have loaded the test up and tried it but I finally did get around to it!:slight_smile:

I’m running windows 10 pro 32GB memory Xampp 8.2.

@stephenwaite I did benchmark the difference between default inno settings and my tuning with a marginal difference of saving about 30 seconds out of 9seconds to load a Flow searching for a year on an near empty appointments table.

Btw, same 7.0.2 database.

RE: I’ll spend a couple hours trying track this down but I have many things going on just now so I’ll report what I find if anything before going back to another pressing project.

thanks for testing @sjpadgett , pushed a PR to speed it up

1 Like

Hello @sjpadgett . Apparently you have been able to verify what I have been explaining, and from what you say it seems that it is not the database. If not, some file in the new update makes queries or some other inappropriate process in the database, causing it to slow down extremely. As a comment, the times you showed can be extended to more than 15 or 20 seconds, if there are two professionals in different centers, working simultaneously.

I wanted to know if it still works for you, to remove the sensitive data of the patients from my database, to pass it on to you. I could also extract the data and generate an administrator user, so that several of us can enter simultaneously and see the different delays. In that case, you could run @adunsulag 's script, see if it works for you.

Meanwhile, I have come up with a solution but I don’t know if it is correct, since I don’t know exactly what openemr saves in the documents folder.
1- leave the base as it is from openemr 7.0.2
2- copy the documents folder from version 6
3- copy and overwrite the documents folder of the latter with the one I am currently using in version 7.0.2, this way if the speed is the same again, we have the problem in another part of the update and not in the documents folder. I think that if I follow these steps I should not lose any information loaded to date with v 7.0.2. I am right?

greetings to all

1 Like

Ahhh and … I’m sorry for ma english !!!

I’m sorry for my english

@stephenwaite found a bug and has fixed in PR fix: speed up slow board using patient tracker services as globals by stephenwaite · Pull Request #7330 · openemr/openemr · GitHub will be in patch or you can patch yourself if able.

Thanks @sjpadgett , I have seen it, if you give me a brief instruction on how to patch it until it comes out in a complete patch, I will do it, and this Wednesday afternoon I will comment if I notice any changes, Wednesdays are when we work simultaneously, and the system almost can not be used.

Should I replace the red lines with the green lines of each of the 3 files that are in changed files?

Hi @sjpadgett , for some reason the file
src/Services/AppointmentService.php , is not the same as the one you modified. I copied the modified part of mine, what is the error?
/**
* check to see if a status code exist as a check in
* @param $option
* @return bool
/
public function isCheckInStatus($option)
public static function isCheckInStatus($option)
{
$row = sqlQuery("SELECT toggle_setting_1 FROM list_options WHERE " .
“list_id = ‘apptstat’ AND option_id = ? AND activity = 1”, array($option));
if (empty($row[‘toggle_setting_1’])) {
return(false);
}
return(true);
}
/
*
* check to see if a status code exist as a check out
* @param $option
* @return bool
*/
public function isCheckOutStatus($option)
public static function isCheckOutStatus($option)

and my file:

  • @return bool
    */
    public function isCheckOutStatus($option)
    {
    $row = sqlQuery("SELECT toggle_setting_2 FROM list_options WHERE " .
    “list_id = ‘apptstat’ AND option_id = ? AND activity = 1”, array($option));
    if (empty($row[‘toggle_setting_2’])) {
    return(false);
    }

      return(true);
    

    }

    public function isPendingStatus($option)
    {
    // TODO: @adunsulag is there ANY way to track this in the database of what statii are pending?
    if ($option == ‘^’) {
    return true;
    }
    return false;
    }

    /**

    • Returns a list of appointment statuses (also used with encounters).
    • @return array
      */
      public function getAppointmentStatuses()
      {
      $listService = new ListService();
      $options = $listService->getOptionsByListName(‘apptstat’, [‘activity’ => 1]);
      return $options;
      }

    /**

    • Checks to see if the passed in status is a valid appointment status for calendar appointments.
    • @param $status_option_id The status to check if its a valid appointment status
    • @return bool True if its valid, false otherwise
      */
      public function isValidAppointmentStatus($status_option_id)
      {
      $listService = new ListService();
      $option = $listService->getListOption(‘apptstat’, $status_option_id);
      if (!empty($option)) {
      return true;
      }
      return false;
      }

Hi @sjpadgett . I have made the changes, the file that I had, which was very different from the one you published, I replaced it in its entirety with your code. In principle it seems much faster. But on Wednesday, which is when we are working from two centers, I will take a closer look at the performance. On the other hand, I found some small errors, when the shift status changes, the screen remains blank and must be closed manually. The same thing happens when assigning a shift.

assigning a shift

changed status

saludos

hi @mlobo4370 , there was a bug in the PR, you can apply these changes to fix the appointment errors.

2 Likes

Thanks @stephenwaite . Right now is work fine !!!

1 Like

Thanks for hanging in there and helping fix a bug @mlobo4370
Good luck!

1 Like

thanks to all of you !!!

1 Like