|Summary:||__jexl2 doesn't scale with multiple CPU cores|
|Product:||JMeter||Reporter:||Mikhail Epikhin <epikhinm>|
|Component:||Main||Assignee:||JMeter issues mailing list <issues>|
adding threadLocal support
1024 threads are blocked on one jexl2 execute method
Description Mikhail Epikhin 2014-07-10 14:40:03 UTC
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!
Comment 1 Mikhail Epikhin 2014-07-10 14:53:03 UTC
Method "getJexlEngine" should be static. My fault.
Comment 2 UbikLoadPack support 2014-07-10 14:56:27 UTC
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
Comment 3 Mikhail Epikhin 2014-07-10 15:16:18 UTC
Created attachment 31807 [details] 1024 threads are blocked on one jexl2 execute method
Comment 4 Mikhail Epikhin 2014-07-10 15:19:59 UTC
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.
Comment 5 Mikhail Epikhin 2014-07-11 08:05:04 UTC
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.
Comment 6 Philippe Mouawad 2014-07-12 13:25:09 UTC
Affects version from at least 2.5 up to 2.11
Comment 7 Philippe Mouawad 2014-07-12 13:32:30 UTC
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
Comment 8 Mikhail Epikhin 2014-07-12 17:48:23 UTC
Thank you, folks!:)