ub007 0 Newbie Poster

Good Day!

I have set up virtual IPs on my Ubuntu client machine & assigned IPs
192.168.12.3 - eth0
192.168.12.4 - eth0:1
192.168.12.5 - eth0:2
192.168.12.6 - eth0:3

I have written python code to send multiple HTTP requests to my web server to load test it.When I check the logs on the apache server ,i find that the HTTP 'GET' request is sent from the client IP 192.168.12.3.Is there any way that I can send the http requests from the other IPs on the virtual interfaces?

def send(self, url):
        conn = httplib.HTTPConnection(url)
        try:
            conn.request('GET', url)
            body = conn.getresponse().read()

This code works fine,but since the apache default configuration doesnt allow a large number of simultaneous requests from single host,the code fails to load the server to my expectation.(Ofcourse I can change the default configuration,but wish to try something else)Hence was wondering whether I could possibly send 'get' requests randomly from the virtual IPs? I could then have a list -.txt file of virtual IPs,the python script could fetch it and send the HTTP requets (in a loop)......Appreciate if anyone could suggest a way to do this.I am new to python...thanks in advance


CHeers
David

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.