2
votes

Here is my JMeter setup:

  • testing web services
  • distrbiuted testing, 1 master, 20 slaves (potentially 100 if we decide to go with blazemeter)
  • a file containing testdata, integer per line see [1] for an example
  • a thread group with 20 users (20x20=400 requests)
  • CSV Data Set Config, with \n as separator

[1] Example of testdata file, each line represents an id that will be used as Web Service parameter:

23
8677
10029
29957
1001

My question is: how to distribute the data amoung the slaves so that each machine will use distinct part of the testfile and select test data items in a random manner? One way would be to split the test file into separat parts, but is it possible to make it more dynamic? I am thinking towards "machine x will read lines 0-20, machine y 21-40 and so on". In the answer to this question it is mentioned that CSVs are local, but it is possible to dynamically read different lines of the csv?

2

2 Answers

1
votes

If you do go with BlazeMeter, they have a built in function that does exactly this. In advanced options there is a checkbox that says:

[ ] Split any CSV file to unique files and distribute among the load servers.

0
votes

Have you looked at the split command?

$ split --help
Usage: split [OPTION] [INPUT [PREFIX]]
Output fixed-size pieces of INPUT to PREFIXaa, PREFIXab, ...; default
size is 1000 lines, and default PREFIX is `x'.  With no INPUT, or when INPUT
is -, read standard input.

Mandatory arguments to long options are mandatory for short options too.
  -a, --suffix-length=N   use suffixes of length N (default 2)
  -b, --bytes=SIZE        put SIZE bytes per output file
  -C, --line-bytes=SIZE   put at most SIZE bytes of lines per output file
  -d, --numeric-suffixes  use numeric suffixes instead of alphabetic
  -l, --lines=NUMBER      put NUMBER lines per output file
      --verbose           print a diagnostic to standard error just
                            before each output file is opened
      --help     display this help and exit
      --version  output version information and exit

You could do something like:

split -l 20 filename