I’m super excited to summarise the work done in TRUNK-6417. Let me thank our volunteer contributors first: @iam0mujuzi and @suubi7! Thanks to @mseaton and @ibacher for module fixes and @dkayiwa for code reviews and testing. Finally thanks to @OpenMRSInc for finding a way to fund my work on this!
All the work is available in openmrs-core and platform 2.9.x. Some improvements have also been done in modules.
As reported by our new StartupPerformanceIT tests Platform 2.9.x starts up ~24% faster compared to Platform 2.8.x. Also it’s worth noting that StartupPerformanceIT is limited to 2 vCPUs to simulate lesser hardware. On machines with more cores, the improvements are even more significant thanks to parallel processing.
Similar results (~18%) are observed for O3 running on openmrs-core 2.9.x, which is available for testing on dockerhub in the 3.6.x-core-2.9 tag.
O3 on my machine initially started up in 45.8 seconds (as indicated in this thread). It now starts in 18.5 seconds!
For the full list of changes please see TRUNK-6417.
To get some benefits without upgrading to 2.9.x:
- Upgrade from JDK8 to JDK11
- Upgrade to webservices.rest 3.1.0-SNAPSHOT
- Upgrade to attachments 4.0.0-SNAPSHOT
- Upgrade to event 4.0.0-SNAPSHOT
If you upgrade to core 2.9.x, you will benefit from additional optimisations:
- Fixed to redeploy war only upon changes
- Fixed to unpack modules only upon changes instead of on each restart
- Skipped db schema checks and initial setup if version of core or module is same
Also it’s worth noting that since OpenMRS Core 2.9.x we are issuing a warning, if we detect a very common issue with OpenMRS services declared in xml using @Autowired, which may slow down each startup a few times. See TRUNK-6421. It should help distributions to quickly identify this particular startup performance issue within their custom modules.
I’ll be joining the platform call next week to go through changes and answer any questions.
Please let us know what your results are! To compare O3 startup clone openmrs-distro-referenceapplication and run:
TAG=3.5.0 docker compose -f docker-compose.yml up
TAG=3.6.x-core-2.9 docker compose -f docker-compose.yml up
Initial setup/upgrade (first start) is long (~10 minutes, we haven’t worked on improving that yet) so test consecutive starts i.e. re-run these commands after initial setup is done.