Closed sharadgana closed 13 years ago
Hi,
yes taking random urls from a file will work, You can put somethink like this in your setUp to get a list of urls:
import os
from random import randint
def get_random_lines(filename, nb_line):
"""Return a list of lines randomly taken from filename"""
fd = open(filename, "r")
filesize = os.stat(filename)[6]
ret = []
for i in range(nb_line):
pos = max(randint(0, filesize - 40), 0)
fd.seek(pos)
fd.readline() # skip line
ret.append(fd.readline().strip())
return ret
ben
Hi,
Does the file containing the urls need to be present on all the loadtesting servers or one the master server ? IIUC, the master controller server ships the virtualenv to the loadtesting servers, so does the URL file also gets shipped along .
Hi, Yes the content of the test directory is duplicated over each node.
What is the best way to loadtest a site with mutliple URLS ( ~10000 urls) in a distributed fashion ? I was thinking of writing a Loadtest Case that opens the file ( file containing the urls) and randomly choosing a URL. Is this a suggested way ?