title: JMeter: Dividing dataset between 'users'
body: <p>I have a Dataset, obtained from a DataBase query, of about 5,000 elements. I would like to divide this data into chunks and then have the 'users' (threads) make a HTTP request. </p>
  
  <p>The purpose of this is we have a site that gives realtime information on transient data, I want to simulate multiple concurrent requests against the service.</p>
  
  <p>1 - Tried to create a test plan where the DB query was done and then processed via a HTTP request via a ForEach controller. This works fine when I have only 1 'user', however; if I increase the user count to 2+ then the DB query is run 2+ times and each 'user' runs through the entire 5,000+ data points</p>
  
  <p>2 - I tried moving the DB query into it's own Thread Group and then using BeanShell to put the data into the environment (props.add(...)). This worked in that the data was there but again each 'user' in the http request Thread Group iterated all the data.</p>
  
  <p>Ideally what I would like is to take the data, and have the HTTP Request Thread Group divide the data so that Thread 1 takes the first 2,500 and that Thread 2 takes the second 2,500 (or if there are 4 'users' then thread 1 takes the first 1,250, thread 2 the next 1,250 and so on).</p>
  
  <p>I just started looking at JMeter and I don't think it can do this "automatically" but I wanted to ask in case I'm missing something obvious.</p>