Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > unexpected performance from threads and network client benchmarking

Reply
Thread Tools

unexpected performance from threads and network client benchmarking

 
 
Project2501
Guest
Posts: n/a
 
      04-12-2004
i'm a little puzzled by the received wisdom of python threads.

the wisdom says that you will not see any performance increase from the
use of threads on the client side trying to it a server (high request rate).

this is explained in terms of the GIL..

but i do see a difference... on python 2.3 on freebsd4.9 and linux 2.6

here is the pseudocode:

loop:
create a thread which will query a server and wait for response
sleep(for interval)

that's it. the interval in the sleep does change in steps over time. the
threads themselves are passes the current time.time() and they themslves
take the difference between this time and the time.time at which the
response was received. (with a timeout). threads are created up to a given
maximum (finished threads decrement a global counter).

ok - now the interesting bit.

with a maximum of one client thread at a time, the graphs responce time
against the time.time() (at thread creation) are largely flat but with
random jumps...

as more client threads are allowed, the graphs become smoother with
generally higher peak responce times ... and show:

* initial flat response time - good, server is able to cope nicely
* increase (almost linear) as the rate increases - server is queueing
requests? or is taking longer to schedule more requests. whatever.
* again, a flat rate at high request rates. possible client limit.
perhaps reaching time/scheduler resolution of the python runtime?

there is higher responce time from the server as more client threads
attack it - why? if they can only execute one at a time? isi t because the
switching between them is quicker than the creation of a new attack thread
when there a max of 1 (sequential client)?

the target server is single threaded (radiator radius server, is well
known as single threaded and sequential)- it handles requests
sequentially! the client and server machines are also uni-processor.

Does this mean that there is a benefit to python threads? i'm puzzled! why
the benefit in responce times?
 
Reply With Quote
 
 
 
 
Aahz
Guest
Posts: n/a
 
      04-20-2004
In article <(E-Mail Removed)> ,
Project2501 <(E-Mail Removed)> wrote:
>
>the wisdom says that you will not see any performance increase from the
>use of threads on the client side trying to it a server (high request rate).
>
>this is explained in terms of the GIL..


Huh? Where did you see this "wisdom"? This is precisely one of the
prime use cases for threading. See
http://pythoncraft.com/OSCON2001/index.html
--
Aahz ((E-Mail Removed)) <*> http://www.pythoncraft.com/

"I used to have a .sig but I found it impossible to please everyone..." --SFJ
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Testing memory usage and benchmarking web applications Andy B. ASP .Net 0 02-26-2009 10:04 AM
Benchmarking multiplications and additions Michel Rouzic C Programming 10 03-21-2006 06:50 PM
C# and Perl benchmarking with DeDRMS? Bill Perl Misc 0 04-29-2004 02:04 AM
Unexpected performance results Dave C++ 1 04-08-2004 07:06 PM
XSLT benchmarking and performance advice ? Andy Dingley XML 3 02-11-2004 01:06 AM



Advertisments