Whilst profiling my new low contention buffer allocator in a ‘real world’ situation recently I spent quite a lot of time trying to work out what I was looking for and when it should happen. Since the allocator improves performance by reducing lock contention it only shines when there IS lock contention. I added some more monitoring to the existing buffer allocator so that it can give an indication of when it’s going to block during an allocation or release operation (by using TryEnterCriticalSection() followed by a monitoring notification and then an EnterCriticalSection() when the try has failed).
I’m continuing to help my performance obsessed client squeeze more out of his server. As always we’ve been using perfmon to view the server’s performance counters and since we were investigating CPU spikes we were interested in the thread activity counters that the server exposed.
The various perfmon enabled example servers that ship with The Server Framework have always exposed counters that show the number of active and processing threads from various thread pools.
The new release of the licensed, high performance, I/O completion port, server framework includes lots of new example clients and servers; the framework now comes with 74 fully working example that showcase various aspects of the framework.
Since the UDP side of the framework has undergone a lot of work recently to support filtering and in preparation for the release of several reliable UDP protocols there are lots of new UDP server examples.
So far I’ve found Visual Studio 2010 quite a compelling upgrade from Visual Studio 2008 for native C++ development. Intellisense is better, the build experience seems smoother and faster, editing on a decent development box seems OK, the various profiling and concurrency tools look interesting and, well, it mostly works quite nicely.
It’s a pity that there are some rough edges. I’ve been seeing crashes when I update project and solution files whilst it has them open (a common thing to do if you’re working with source control).
The latest release of The Server Framework gives you the option of building with FILE_SKIP_COMPLETION_PORT_ON_SUCCESS enabled for various parts of the framework. You can enable it for stream and datagram sockets independently and also for the async file reader and writer classes. This option potentially improves performance by allowing overlapped I/O that completes straight away to be handled by the thread that issued the I/O request rather than by a thread that is servicing the I/O Completion Port that the socket or file handle concerned is associated with.
I’ve been working on some performance tuning for a client of mine recently and whilst much of the tuning has been specific to the details of the their particular server design, eventually I can always get to the point where there are some improvements that can be done to the framework itself. It’s nice to have a “real world” performance tuning scenario as I find that tuning example servers can be pointless as the example may not match a real world scenario.
There are two bugs in the Performance Counter library and example servers that mean that performance counters built with the library and following the examples shown in the example servers will fail to work correctly when viewed remotely from another machine. What’s more the remote instance of perfmon will fail to display any counters from the machine with the broken performance counters installed.
The first problem is that the code that checks to see that the process that has loaded the counter dll has the correct privileges to be able to connect to the shared memory segment that is used to communicate between the service and the counters is broken when it’s called from within svchost.
Our Industrial Control Client has engaged us to continue with several pieces of work for them on an ongoing basis.
Today I had a day which I knew from the start would be broken up due to pre-arranged calls and meetings out of the office, and so I decided to deal with a few low importance items on my “todo” list. One of them was to do a proof of concept for a new tool that I might work on. I had a thoroughly enjoyable time hacking an old tool into shape so that I could use some of the technology in the new tool.
The latest release of The Server Framework is now available. This release includes the following changes.
The following changes were made to the libraries.
Admin Library - 6.2
We now support Visual Studio 2010. At present the code has only been tested with the beta and release candidate versions.
New build configuration options. All of these are enabled by defining the option to 1 in Config.h and disabled by defining them to 0; the default state if you do not do anything in Config.