473,324 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

select performance on windows

Python 2.3 Windows NT 4.0 (512M, PIII-500)

Here are results of performance comparison of several strategies of
multiple socket handling (server side).

To do this comparison I've written 3 servers and a client:

1. thread per connection (SocketServer based)
2. asynchat based
3. asynchat + worker thread.
4. multithreaded client

All these servers are reading text strings from connected clients;
convert them to upper case and return to the client.
In the case of asynchat + worker thread, worker thread waits on Queue
and posts "uppercased data" to server queue which is periodically
checked by loop.

Because asyncore.loop does not return control to the caller, I had to
overwrite this function, by extending asyncore.loop:

def loop(timeout=30.0, use_poll=0, map=None, after_pool = None):
...............................
while map:
poll_fun(timeout, map)
if (after_pool):
after_pool(map)

In essence after timeout has expired I check the server queue.

The client is written in such a way, that after connection is made, it
does not start the conversation for 2 minutes, allowing to check the
overhead. The timeout value has to be set reasonably low: 200-500 ms.
(With 400 sockets and timeout = 0.2 overhead is 3-5 percent CPU time).

Client connection sends random length strings in the range(1, 9999),
reads the reply and sleeps up to 30 seconds. Then it repeats the loop.

Here are the results in the form x/y, where: x is average precent of
cpu usage and y maximum precent of cpu usage,
NS - number of connected sockets.

NS thread per connection asyncore asyncore+worker
64 0.5/2.0 2.7/6.9 2/6
128 1.0/3.0 7.4/22.8 6.6/19
256 1.6/6.0 26/43 21/33
400 3.5/9.0 52/75 46/67

The throuput and reply latency are measured on the client and are
aproximately the same for all servers.

Any comments?
Jul 18 '05 #1
0 1051

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jonathan Fine | last post by:
Hello I have written a program that interacts with a command line program. Roughly speaking, it mimics human interaction. (With more speed and accuracy, less intelligence.) It works fine...
1
by: Luc | last post by:
I am using Visual Studio 2003 and am getting lousy performance after using a datatable select and then trying to assign a value to a column of the row that was found: DataTable dt = new...
11
by: Michi Henning | last post by:
Hi, I'm using a blocking Select() call on a socket with a timeout value of -1. I'd expect the call to block indefinitely, but it doesn't. When I use Poll() instead, a timeout of -1 works fine...
13
by: bjarne | last post by:
Willy Denoyette wrote; > ... it > was not the intention of StrousTrup to the achieve the level of efficiency > of C when he invented C++, ... Ahmmm. It was my aim to match the performance...
11
by: Richard Maher | last post by:
Hi, I have read many of the copius entries on the subject of IE performance (or the lack thereof) when populating Select Lists. I don't mind the insert performance so much, (I get 100x120byte...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.