New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppContext.getProperty() uses poorly-scaling System.getProperty inside #1222

Closed
alexbudarov opened this Issue Aug 29, 2018 · 2 comments

Comments

@alexbudarov
Copy link
Contributor

alexbudarov commented Aug 29, 2018

Environment

  • Platform version: 6.8.12

Description of the bug or enhancement

Have been performing performance testing with JVisualVM.
One of CPU profile method chains shows interesting info:
image

AppContext.getProperty() uses System.getProperty() inside.
But System.getProperty() is implemented via Hashtable class. Every get() call enters a global synchronized block and therefore is poorly scalable in multithread environment.

I think that all platform code assumes that AppContext.getProperty() is cheap and highly scalable. So depending on System.getProperty() is a problem.

@alexbudarov alexbudarov changed the title AppContext.getProperty() uses poorly-scalable System.getProperty inside AppContext.getProperty() uses poorly-scaling System.getProperty inside Aug 29, 2018

@knstvk knstvk added this to the Release 6.10 milestone Aug 29, 2018

knstvk added a commit that referenced this issue Sep 21, 2018

knstvk added a commit that referenced this issue Sep 21, 2018

knstvk added a commit that referenced this issue Sep 21, 2018

knstvk added a commit that referenced this issue Sep 21, 2018

@knstvk

This comment has been minimized.

Copy link
Member

knstvk commented Sep 21, 2018

Solution

System properties are read on startup and cached in a ConcurrentHashMap. Consequently, changes in system properties made at runtime do not affect the system. If you need to read the new value of a system property, reset the cache using the clearSystemPropertiesCache() methods of the CachingFacadeMBean JMX beans available in the core and web modules.

@knstvk knstvk assigned myatlevEvg and natfirst and unassigned myatlevEvg Sep 21, 2018

@knstvk

This comment has been minimized.

Copy link
Member

knstvk commented Sep 21, 2018

For manual testing: try to redefine an app property with a system property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment