Created attachment 31806 [details] adding threadLocal support Hello comrades! I have a problem with big testplan and many If controllers using jexl2 with complex expressions. Many threads are locking on JexlEngine. So, JMeter support jdk 1.6+, maybe we should start to use ThreadLocal?:) ThreadLocal support in java since 1.6 http://docs.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html This simple patch scaleup overall throughput of my test. I think we can commit it and increase performance of logic controllers:) What about add similar patches for other functions? It would be nice!
Method "getJexlEngine" should be static. My fault.
Hello, Thanks for analysis and contribution. Would it be possible to attach the proof of contention in the Bugzilla ? Using ThreadLocal might impact memory usage negatively (note by the way it is used frequently in JMeter :-) ) even before JDK6. Thanks @ubikloadpack
Created attachment 31807 [details] 1024 threads are blocked on one jexl2 execute method
I can't attach test-case for NDA reasons. In test-case i have problems on throughput ~200rps. Applying patch increased throughput to 700rps and system under test are broken under load.
For decrease memory consumption we can use method setCache(int size) of JexlEngine. By default Jmeter have cache size 512 per jexl instance. We can decrease than parameter or set value from jmeter configs.
Affects version from at least 2.5 up to 2.11
Hello, Thanks for contribution. Commited with addition of ThreadListener interface implementation to cleanup thread local at thread end. If you can test nightly build and give feedback, it would be great. Thanks Date: Sat Jul 12 13:30:51 2014 New Revision: 1609915 URL: http://svn.apache.org/r1609915 Log: Bug 56708 - __jexl2 doesn't scale with multiple CPU cores Bugzilla Id: 56708 Modified: jmeter/trunk/src/functions/org/apache/jmeter/functions/Jexl2Function.java jmeter/trunk/xdocs/changes.xml
Thank you, folks!:)
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3396