As your project grows and the number of proxy services you have in the project grows significantly (>100) you might notice that the performance of the services degrades heavily.
This can be attributed to the fact that the OSB is now unable to Cache all your services at runtime.
OSB caches proxy service runtime meta-data using a two-level cache with static and dynamic sections. The cache introduces a performance trade off between memory consumption and compilation cost. Note that caching proxy services may help throughput but could impact memory usage.
The static section is an upper-bound Least Recently Used (LRU) cache that is never garbage collected. When a proxy service is bumped from the static section, it is demoted to the dynamic section where the cache can be garbage collected when there is memory pressure.
Fortunately for us there is a fix for this in place already.
The number of proxy services in the static portion of the cache can be tuned by configuring the RouterRuntimeCache appropriately.
It’s done using a system property
This setting can be increased to a desired value provided there is sufficient memory for runtime data processing for large number of proxy services, or you will have to increase the system JVM settings accordingly along with the increase to the runtime cache value.
This property value can be set in the setDomainEnv.sh file as an extra java argument as follows:
Additionally, you might still notice that the first invocation is slow as we see while trying to test the services, this is due to the fact that these services are being compiled then and any future invocations will be a lot faster due to them being in the static Cache.
There is a very interesting article by Mark Smith illustrating how we can utilise this setting to improve the SLA and ensure that the first invocation does not cause you to fail on your SLA. https://blogs.oracle.com/MarkSmith/entry/osb_proxy_initialization/