how we use osgi to build open liberty
play

How we use OSGi to build Open Liberty Alasdair Nottingham - IBM 1 - PowerPoint PPT Presentation

How we use OSGi to build Open Liberty Alasdair Nottingham - IBM 1 Background 2 Project goals Implement Jakarta EE Small Footprint Start fast Composible Dynamic Easy to use 3 Just Enough App Server You


  1. How we use OSGi to build Open Liberty Alasdair Nottingham - IBM 1

  2. Background 2

  3. Project goals • Implement Jakarta EE • Small Footprint • Start fast • Composible • Dynamic • Easy to use 3

  4. Just Enough App Server • You control which features are loaded into each server instance <feature>jsf-2.3</feature> <feature>servlet-4.0</feature> jsp-2.3 jsf-2.3 Servlet-4.0 http-2.0 appmgr Kernel 4

  5. Server configuration Metatype describes config • <server> DS describes config • <featureManager> <feature>javaee-8.0</feature> CA parses XML • </featureManager> Subsystem Feature • <httpEndpoint id=“defaultHttpEndpoint” httpPort=“8080”/> describes bundles for feature <webApplication location=“myWeb.war” contextRoot=“/”/> DS component activated to • </server> start http transport DS component activated to • start application 5

  6. Jakarta EE on OSGi ear region jar jar Bundle A war Gateway jar jar Bundle B Bundle c custom classloaders 6

  7. Last 12 months 9

  8. Towards one second start-up 2019 Progression of OpenLiberty+OpenJ9 startup time (seconds) 2.5 2 Seconds 1.5 1 0.5 0 December March April July August September Amost halved startup time due to app server and JVM improvements through 2019 2 hyperthreaded cpus on 2 socket system, each socket containing 24 cores. cpu model: Intel Xeon Platinum 8168 CPU @ 2.70 GHz 10 Application PingPerf - https://github.com/HotswapProjects/pingperf

  9. Performance Improvements • Equinox • Regions (Equinox) • Metatype (Equinox) • Declarative Services (Felix SCR) • Config Admin (Liberty) • Subsystem Features (Liberty) 11

  10. Things that are expensive • findEntries Enumeration e = b.findEntries("OSGI-INF", "*.xml", true); • Searching jar files for sub-paths is expensive • XML Parsing • Text file parsing • Opening and reading many files vs one • Case insensitive matching in filters • Reflection to find methods on DS components 12

  11. Parallel Bundle start • Equinox activates bundle one by one • Updated to support starting bundles within start level in parallel • Turns out a lot of code actually depends on bundle start order when you have a predictable install order 13

  12. Things we learned • Shutdown is not as simple as stopping the framework • Statics and service do not mix & match • Use the build tools • Very powerful for large complex software • DS and ConfigAdmin together are brilliant • High learning curve • Java SE classloading assumptions don’t mix well in OSGi • Shuffle bundle install order to avoid start time dependencies 14

  13. Thoughts on future 15 15

  14. • Can Liberty function without the OSGi Modularity layer? • Can we choose the modularity layer and swap between OSGi, JPMS and none? • Stick with DS, CA, services, but not OSGi bundles 16

Recommend


More recommend