Exactly How fast is Linux Compared to Windows NT?

David Elson
Babel Com Australia
Email: del@babel.matra.com.au

Abstract

A common problem in a small- to medium-sized business is the implementation of a small PC network. I have in a number of places implemented one or the other Linux (running Samba) and Windows NT in various positions in the network - as a file server, as a gateway and as a print server.

In one instance, I have two servers running side by side on a network, both acting as fairly basic file servers - one running Linux and the other running NT. I use these servers to benchmark the two operating systems and measure their suitability for various tasks.

Both machines have identical hardware, networking and memory, and are both connected to an identical RAID unit operating as the primary disk storage.

I have started with a fairly basic benchmarking excercise, which is only a small part of the task at hand. The real effort of actually benchmarking several such systems could turn into a research project of its own. In this paper, I examine some of the whys and wherefores of such a project.

1 Some Basic Numbers

To start the benchmarking exercise, I took two basic servers side by side with very similar specifications. I then ran some basic performance tests with the two operating systems.

1.1 Specifications

The two servers were configured with the following specifications:

Of course your mileage may vary when you run these tests for yourself. Both machines were identical (supplied under contract from the same computer shop); there were several other features included with the PCs but these would not have affected the performance of the machines and so I have not listed them above.

If you choose a PC with more or less RAM then you will get different results. You will end up with probably widely varying results depending on the configuration of the disks that you use, whether you use one chipset or another on the motherboards, ethernet cards, etc.

Of course the two servers were, for the purpose of this excercise, running different operating systems. These were:

There are later variants of these operating systems available which in turn invalidates everything I am about to say, but I shall press on regardless.

1.2 Setting up for the tests

There are a lot of factors that need to be taken into account when performing benchmarks. There are many factors that can slow a system down - some of these can be measured and some cannot.

These are the things that occurred to me when I was doing these tests that I was able to take care of:

Running these tests on a network with zero load in itself presents the first problem - I have managed in this case to show the performance of these two systems under zero network load, but what is the performance under higher load?

The difficulty is that it is very hard to set up a 'test' network that has a fixed (non-zero) load that is also reliable and measureable. I could have artificially flooded the network with 'ping' or other packets, either at random or fixed intervals, or provided another external stimulus to the network to simulate a fixed level of LAN activity, but it would have been very difficult (because of the nature of CSMA/CD networks including ethernet) to determine exactly what proportion of the network bandwidth was in use at any point in time.

With the right equipment (and a lot more time and resources), this would be achievable and possibly even worthwhile.

1.3 What can we measure?

Windows NT and Unix are radically different operating systems. This means that they do a number of things in a radically different manner. This is one of the primary reasons that makes such a benchmarking task so difficult or rather, so inexact.

The two operating systems do, however, perform a basic set of tasks in common. These tasks include:

It is primarily the first two of these points in which I am interested.

1.3.1 Disk Performance

With respect to the first point, I am interested in whether Linux or NT reads and writes disk files faster than the other. I performed a simple file-copy test, where I took an empty disk partition, and created a 50MB file on it, then copied that file. I repeated that action (cleaned the disk, created a file, then copied that file) 500 times, and took the average of the results.

The results were as follows:

Linux
25.45 sec
Windows NT
26.75 sec
Well, really no great surprises there. Most of the work here is involved in getting the data to and from the disks. Having a slightly more efficient file system (ext2fs) and somewhat different caching algorithms probably gives Linux the edge here, but the percentage is very slight.

1.3.2 Network Performance

This is somewhat harder to measure - and there are several quite radically different meanings to the terms 'network performance' in any case.

What I have chosen to measure is what the user sees on his/her end of the network - copying files to and from the server machine. Although this is not a true indication of network performance, it is one thing that is easy to measure and gives some (although not an exact) measure of the relative strengths of these operating systems with respect to user level applications.

For the purpose of this exercise, I loaded Samba version 1.9.15 patch level 3 on to the Linux PC. This was set up in a very basic configuration with almost no security. On the Windows NT end, all protocols other than TCP/IP were disabled (that is, no NetBEUI or IPX/SPX - after all it is the operating system and not the protocol I am analysing here).

The figures for a similar test to the one above performed across the network were:

Linux      95.47 sec
Windows NT      112.75 sec
The difference here is somewhat more pronounced, Linux scores about 15.4% faster than the NT machine, as opposed to the 4.9% difference in disk to disk copying.

I am aware that Andrew Tridgell and various others have performed some benchmarking on Samba, as well as having provided some useful information about performance improvements that can be made with the Samba server (see Speed.txt in the Samba doc/ directory, included with the source code of the Samba distribution). I deliberately made absolutely no attempt to implement any of the changes that were suggested in that file as I wanted to operate with, as closely as possible, 'vanilla' versions of the systems concerned.

1.4 What can't we measure?

As I stated at the start of the last section, these two operating systems are radically different (and I'm not going to attempt to stick my neck out here and explain in exactly what ways they are different).

These differences make certain things very hard to measure. In particular, certain utilities that are available on Linux are not available on Windows NT, and vice versa. I could use a C compiler to provide my own versions of dd or WINFILE.EXE but that was not the objective of this paper - I am attempting to benchmark the operating systems in their raw 'vanilla' state and I certainly don't want the efficiencies or otherwise of the C compilers to interfere with this (there are other benchmarking suites that will do that task).

The first benchmark allowed me to test the process of reading and writing a file. It did not allow me to individually test the components of such an operation.

The components of this operation that I would have liked to have measured are:

Measuring the above things is possible; however, the way in which I would have to measure them would differ between the two operating systems and this difference would, in turn, distort the results.

Similarly, in measuring network performance I would like to be able to measure all of the components of this performance, including all of the components listed above. In many cases, the lack of homogenous tools is a problem; in some cases, I just do not have the time or resources. However, the biggest single issue that stops me being able to do all of the measurements I want to do is the lack of the source code for the NT Server operating system!

1.5 Where next?

There are many other tests that can be run. As far as I know, there does not exist a fully portable operating system and network benchmark suite. Before any more significantly meaningful tests are begun, such a test suite would need to be developed.

I have my own idea of the sorts of things that this suite should be able to do, including:

2 Does it really matter?

The short answer is 'no'.

I am continually reminded of an article that went into circulation in the Australian Unix community some years ago, into which a great deal of work had been placed. The author of that article had to all intents and purposes dismantled the kernels of several vendor supplied Unix System V variants and performed some radical and quite thorough benchmarking on both the operating systems and the machines that they were running on (low end minicomputers).

The final decision on what system to buy was later taken by management and was based entirely on price.

However, more importantly, the numbers collected above (and I could collect a large deal more on other operating systems such as Novell Netware, Solaris, SCO OpenServer, etc.) are to a large extent meaningless in the real world. There are many factors, other than the raw disk performance of the operating system, that affect the total throughput of a network. These include:

Furthermore, the network performance is, in turn, only a small part of the total on-the-desktop performance for your average user. Any number of factors can affect the total performance, the majority of which are usually at the desktop rather than the server end (type of application being run, amount of memory available, speed of CPU, etc).

I could of course go on for several pages about items that affect network performance. However, it is relatively clear that a 5% speed difference in the raw throughput of the operating system (or even a 15% difference in the raw network performance at zero load) would not translate into anything more than 1% in real performance at the user level - probably much less.

3 Conclusions

I guess the reason for my delving into this issue in the first place was being asked the question 'Is Linux or NT fastest as a Web server?'. Further to that question, several advertisements have been running recently stating that a certain brand of operating system has a web server that is faster than web servers under another certain brand of operating system.

The answer to all of these questions is 'It doesn't matter'.

Examine a typical WWW server situation: Company X has put their server onto the Internet. They have purchased a 64K ISDN link to a well-known major Internet service provider.

Just looking at the latency, a typical ISDN router has a latency of between 20ms and 45ms. A LAN may add approximately 1ms to this, something under 5% of the total latency anyway. A typical user somewhere out on the Internet in Australia is likely to have approximately 200ms (modem) plus anywhere between 75 and 500ms (depending on their ISP) latency to Company X's ISDN gateway. That means that the gateway itself has something in the order of 10% impact on the total server - user latency. 1% of that 10% is 0.1% - the net effect of any LAN on the total user - server ratio.

Similarly, examining the bandwidth, a 10MBit/sec LAN will transfer a 50MB file (raw performance) in about 40 seconds assuming the highest possible theoretical bandwidth of 1.25MB/sec. The overhead of TCP/IP and the interference of the operating systems added approximately 150% to this based on the above figures, taking the total transfer time up to 100 seconds or thereabouts.

Assume that the user is experiencing a download time for the file of around 3.5KB/sec (about the maximum you'd expect from a 28.8K modem running 'flat-chat'). That means that the download time for this file over the modem will be about 14500 seconds. The time taken to transmit the file's packets to the router is approximately 0.6% of this time, while the operating system's component is around 0.4%.

These two issues mean that doubling the performance of the operating system could mean anything up to half a percent improvement in the performance of your web server! Impressive? No, I don't think so.


Organised by: AUUG'96 & CSU Return to Conference Proceedings