Summary: | MongoDB Protocol. Slow performance of MongoDB Sampler due to eval function usage | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Mikhail Epikhin <epikhinm> |
Component: | Main | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED DUPLICATE | ||
Severity: | major | CC: | epikhinm, janpaulettles, p.mouawad, philippe.mouawad |
Priority: | P2 | ||
Version: | Nightly (Please specify date) | ||
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Attachments: |
testplan with MongoDB samplers
Testplan with beanshell mongodb samplers insert/find/findOne samplers for mongodb |
Description
Mikhail Epikhin
2013-05-13 20:08:41 UTC
Created attachment 30279 [details]
Testplan with beanshell mongodb samplers
>>https://github.com/apache/jmeter/blob/trunk/src/protocol/mongodb/org/apache/jmeter/protocol/mongodb/sampler/MongoScriptRunner.java#L59
Why using return before finally-block?
Thanks for showing interest in mongometer http://exceptionallyexceptionalexceptions.blogspot.co.uk/2013/01/mongometer-v20.html which I donated to the project a few months back. This 'project' was initially a hack so I could quick and consistently compare the _relative_ performance of multiple mongodb scripts that were attempting to achieve the same outcome. It was never about the performance of the plugin itself, the plugin was the vehicle to compare scripts. I'm more than happy for changes to be made that will improve the usability of the plugin - I'd suggest that the jmeter project owners moderate the changes to the code as they see fit; I'm not precious about it in any way. You can also access the original source on github https://github.com/JanPaulEttles/mongometer With regards to the return prior to the finally clause; what's your issue? The finally clause will always be called prior to the return. Okey, Jan, do you understand, the all of people, who need test mongodb with this plugin have incorrect and not valid results? This is major reason to not include this into JMeter 2.10 or talk about performance testing mongodb for more simple methods like find/update/delete and anything else. And a lot of people didn't know about it. Please, warning your audience of users.
>>With regards to the return prior to the finally clause; what's your issue? The finally clause will always be called prior to the return.
Thank you, I did not know this
Thanks Mikhail for analysis. Based on your analysis and further investigation, I propose to mark this code as ALPHA for now if we decide to release a version. Maybe we should just keep MongoDB Source Config and let users use Beanshell or JSR223 (Groovy) code to do what the want with it as it can be hard to express through GUI what the API can do. I released three samplers for MongoDB with support this into core for operations: insert, find and findOne. All this samplers give a json, convert to bson and works with mongodb fine on high throughput. For exmaple, insert works cool on 20krps throughput. But, i have a problem. In json's objects a haven't support operators. Like $inc, $gt, and other. It's a big problem. We can include simple samplers insert/find/findOne if you want. Source code: https://github.com/sch1z0phren1a/ApacheJMeter-mongodb-extensions/tree/master/src/main/java/me Example testplan in attachment:) Created attachment 30427 [details]
insert/find/findOne samplers for mongodb
Hello Mikhail, Thanks for feedback, could you attach them as a patch ? I vote for their inclusion but waiting for other commiters opinion. Good luck with this approach. Apart from violating the DRY principle, this approach is rather messy architecturally. Are you planning on having a separate sampler for every API call? The original intention for mongometer was to enable a scratch pad, an area where you were not bound to any predifined interfaces, an area where you can experiment with your mongo scripts to compare their performance in a relative manner. What this, per sampler approach does it to limit the user to the defined samplers. Look, I don't really care what you guys do with mongometer, I've donated it, I'm not looking for any credit and I'm not looking to support anything; you guys asked for it, so I gave it to you. The last thing I'd add on this is, you'd be better off keeping the free text area/scratch pad area, sticking to a single sampler and creating a script-to-java layer. You don't open a separate mongo shell for each type of query, so why should you have to with jmeter? The script to java mapping layer not only allows you to adhere to the DRY principle, it also allows for better unit test coverage, and reduces the number of separate samplers that have to be written and maintained. My 2p. Hello Jean-Paul, Thanks for your comment. We are still investigating on the best approach so your contribution is an interesting one. What is sure is that we need to have an efficient sampler and eval is clearly not recommended by MongoDB even if it clearly solved this issue. As you can see for now we keep the Source element and will see how to have the best from PERFORMANCE and usability. to Jean-Paul, >>Good luck with this approach. Apart from violating the DRY principle, this approach is rather messy architecturally. Are you planning on having a separate sampler for every API call? I just wrote this samplers for my coworkers. They want performance testing simple operations like insert and find. I not created it for apache jmeter and anything opensource project. Just for me, just for my coworkers. I understanding DRY principle, and as you, i want to create simple and good architecture. >>The original intention for mongometer was to enable a scratch pad, an area where you were not bound to any predifined interfaces, an area where you can experiment with your mongo scripts to compare their performance in a relative manner. What this, per sampler approach does it to limit the user to the defined samplers Okey, it's very good idea and MongoDB Java Driver have this eval-call, but it's very slow. And with this method you lock db on throughput ~500rps. What if you script have better performance? How you test it? to Philippe, >>Thanks for feedback, could you attach them as a patch ? >>I vote for their inclusion but waiting for other commiters opinion. It's good idea, but this samplers have a very slow functionality. I think, we can create samper with scripting text area (BeanShell/JSR223). In text area we can describe BSON-object or query for database. It would be more functionality, but something difficult for users. I can opensource it, but i agree with Jean-Paul. We need more functionality and simplify archetecture:) Fixed by introduction of MongoDBHolder and documentation of this limitation, ie only use for functional testing. *** This bug has been marked as a duplicate of bug 54584 *** This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3122 |