[Tutor] Threads very simple examle

Kent Johnson kent37 at tds.net
Thu Sep 10 13:01:06 CEST 2009


On Thu, Sep 10, 2009 at 4:13 AM, Oleg Oltar <oltarasenko at gmail.com> wrote:
> Hi!
>
> I have a question.
> I want to create simple load test for my web application.
>
> Consider the following script:
>
> while 1:
>     urllib2.urlopen("www.example.com")
>
> How can I make it running in several threads?

Have you read at all about threads?
http://www.devshed.com/c/a/Python/Basic-Threading-in-Python/
http://www.wellho.net/solutions/python-python-threads-a-first-example.html

You might consider using an existing load test application, there are
many, some even written in Python:
http://httpd.apache.org/docs/2.0/programs/ab.html
http://www.opensourcetesting.org/performance.php
http://www.softwareqatest.com/qatweb1.html#LOAD

Kent


More information about the Tutor mailing list