473,903 Members | 5,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(timeou t, map)
if (after_pool):

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 1078

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

Similar topics

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 under Linux, using select().
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 DataTable(); dt.Columns.Add("Number", System.Type.GetType("System.Int32")); dt.Columns.Add("Value", System.Type.GetType("System.Double")); for(int i=0;i<2000;i++) {
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 and blocks indefinitely. The net effect is that I cannot write a select on more than one file descripter if I want to block. (With timeout values >= 0, both Select() and Poll() work fine.)
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 of C and I achieved that aim very early on. See, for example "The Design and Evolution of C++". -- Bjarne Stroustrup; http://www.research.att.com/~bs
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 rows inserted/sec up to 500, and 100rows/6secs up to 3000, which isn't great but then the Row Count is clicking away for the user to see and they can hit the "cancel" button at anytime, so overall I'm happy), what really disappoints me is the...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.