Personal tools
You are here: Home / OSCAR EMR version 15 / 5.0 System Administrators / 5.3 Tuning for Speed

5.3 Tuning for Speed

OSCAR at times runs slow, and this might be an issue of configuration. Here are some tips on how to tune OSCAR for speed

First of all are you slow?

Oscar naturally has several areas where it can be slow.  The inbox,  is often the area where this is seen, however chart opening can be slow.

My benchmarks for local access is 7 seconds for a chart open (remote access is 12 seconds) for a simple chart open (albeit a chart with 10+ years of OSCAR data filling all the boxes)
3-6 seconds for Inbox to load the list of all new results and HRM reports
an additional 20 seconds for preview to load for the first time
and an additional 3 seconds for preview to load the next bunch of reports when you reach the end of preview

Tuning OSCAR for speed

More or less in increasing orders of complexity.  Take with a grain of salt as you are getting this from a physician, and not a systems operator type.

1) Physical Memory

If the server is running out of memory then the operating system will write memory to hard disk which substantially and abruptly slows the server.  Look at Admin > System Reports > System status for the box called vmstat

$ vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 1  0 697952 974068 516076 21689712    0    0   102   331    3    3 15  2 82  1  0
In the above example there is plenty free (for more details google vmstat) so this system is not currently running into an issue But if it was physical memory is cheap and easy to add to your machine.

2) Java Memory allocation to Tomcat

Even if you have lots of physical memory if Java is not allowed to use it it will start using the hard drive with the same symptoms. Adding memory will not solve this, you have to increase the allocation. There are many ways to determine how much memory Java is using. In OSCAR 15 enable monitoring (see ). It has lots of performance data (including how much Java memory is being used) on the same well resourced box as in 1) the data is currently as below
Java memory used: 746 Mb / 7,897 Mb
Its fine (at this time) However if it wasn't adjust this in /etc/default/tomcat6 (for OSCAR 15 its in /etc/default/tomcat7) As a rule of thumb (if you lack this data) ensure that a good 60% - 70% of physical memory is allocated to Java.

3) MySQL itself

There are books on tuning it but for most you can run a tool called mysql tuner.  Install it by Simply:
apt-get install mysqltuner
The script will analyse your MySQL instance and suggest settings for  /etc/mysql/my.cnf

4) Oscar indices

As in a library databases use indexes to quicky find the information you want. You can determine if the queries are running quickly by using the monitoring tool. Any query running more than half a second (500ms) is noticable to the end user. Some time has been spent in OSCAR 15 to optimise indices but I still have the following SQL which takes about a second to run
select as id332_, hl7textinf0_.accessionNum as 
accessio2_332_, hl7textinf0_.discipline as discipline332_, 
hl7textinf0_.filler_order_num as filler4_332_, 
hl7textinf0_.final_result_count as final5_332_, hl7textinf0_.first_name 
as first6_332_, hl7textinf0_.health_no as health7_332_, 
hl7textinf0_.lab_no as lab8_332_, hl7textinf0_.label as label332_, 
hl7textinf0_.last_name as last10_332_, hl7textinf0_.obr_date as 
obr11_332_, hl7textinf0_.priorSimply.ity as priority332_, 
hl7textinf0_.report_status as report13_332_, 
hl7textinf0_.requesting_client as requesting14_332_, 
hl7textinf0_.result_status as result15_332_, 
hl7textinf0_.sending_facility as sending16_332_, as 
sex332_ from hl7TextInfo hl7textinf0_ where hl7textinf0_.accessionNum 
like ?
Java Melody Monitoring advises that its run in /lab/ I don't care about a one second wait, and unless this is your problem its something I would ignore anyway. If you lack this monitoring tool you may activate the slow query log of mysql in /etc/mysql/my.cnf by adding the following

 Note that the slow-log itself can slow performance.  Turn it off when you are not using it!

5) Upgrade hardware to a bigger faster box

This is so rarely the issue that I hesitate to suggest it.  However if you are big enough (number of users say > 100) MySQL starts slowing down.  The real symptom of this is that people start volunteering for evening shifts so that they can get through their inboxes quickly. 

You should only consider a bigger box(s) after you have exhausted the above.  In those cases there are ways to split off the OSCAR server(s) from multiple MySQL (or MariaDB) servers that load balance.  This is hard core where most OSCARs have not gone.  Good luck and report back your challenges and success to the list!

Document Actions