0
votes

I am facing a problem in master-slave mode, we have a own jar to create some files after test, but when we run the test in master-slave mode, each slave will create one file, but we only need a summary file in master.

is there a way can instead of master-slave mode, let us use one jmeter server to test 2000~5000 threads? or change some setting to make the files only create in master?

2
Since all the slaves are on the same network as the master (or at least the master can access all of em), why not create a shared file accessible across all slaves and append data to it from different slaves along with the unique info such as timestamp and machinename (this is just for your convenience if in case you want to identify where and when the data came from)? Or if you feel there are gonna be deadlocks in this scenario, you could always combine all files together towards the end of the test to a common file in the master machine using JSR223 or BeanshellM Navneet Krishna
And since you are using your own jar to create files after test, why not make the jar write to the same common location after the test? It would be easier than JSR223 or BeanshellM Navneet Krishna
yeah you are right, now I am trying to change the base code!!Mak Tao
great.. please accept the answer if it helped..M Navneet Krishna

2 Answers

1
votes

JMeter simply executes the same test in the all the slaves. So, all the slaves will try to create the file as you had described if the test is designed to do that.

You could probably use a If Controller for a specific machine to do that.

If Controller ["master"=="${__machineName}"]
     logic to create the file
0
votes

I am facing a problem in master-slave mode, we have a own jar to create some files after test, but when we run the test in master-slave mode, each slave will create one file, but we only need a summary file in master.

Since all the slaves can access the master machine, you can create a common shared file where in the slaves can make their entries based on the data that they have received. This can be done in 2 ways:

  1. You can use a JSR223 sampler or a Beanshell sampler to write files to a common location thereby having just one master copy of the file
  2. You can modify the JAR that you are utilizing right now to do the same work

is there a way can instead of master-slave mode, let us use one jmeter server to test 2000~5000 threads? or change some setting to make the files only create in master?

No. This is currently not a feasible option since the JAR that has been uploaded will be applicable on all the slave machines and hence will create multiple copies of the file.

Besides, if your master machine could generate 2000-5000 threads, I don't think you would have gone for a distributed load test in the first place.

Hope this helps!