We have developed an application to encrypt/decrypt a request/response from/to server. We were doing performance testing of encryption/decryption application where we have observed that encryption/decryption process is taking time, while many threads are doing it at the same time. To identify an issue, we have logged every methods that are part of encryption/decryption process. From logger we have found that Key Fetching process is taking 70-80% of time from overall time of process.
On further analysis, we have found that Key store is internally using HashTable. Is this giving performance issue?
When Key store size is 2002 --- TPS is 85 Key store size is 14007 -- TPS is 38
Please help.
I was facing this issue... and I have answered this on bellow post.
Issue related to execution speed varies with different operation system platform.
Jvm loads key store in memory. And its having hashtable collection as internal storage.
Hashtable is synchronized.
Whenever you perform get operation from key store, than it will return it from in-memory key store not from physical keystore. You can confirm it by using ("top" - %wa section) command in linux base OS.
Key store is using hashtable and it is the root cause behind performance decriment.
I have solved this issue by loading all keys from keystore into ConcurrentHashMap while initializing the project. and later on, All the read operation will be performed from MAP instead of keystore. And make sure that all write operation will be perform on both keystore and MAP.
Java Keystore.getKey() slow while Key store size Increase
Hope this will help..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With