🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #6421

cyclic news file system - tentative performance results

#6421
From: Mark Delany
Date: Tue, 09 Apr 1996 00:00
249 lines
11224 bytes
Let's preface this posting with a caveat or two.

These are early numbers and I'm still very tentative about them. Also
the test environment used to produce these numbers is very
approximate, so any numbers should only be viewed as ballpark at best.

[-- Recall from "How to do a better USENET file system" the idea of a
    cyclic file to store article and NOV data. This has the potential
    to substantially reduce I/O load for a whole stack of reasons:
    serial I/O to the disk, no UFS to fight, no expire, etc.     --]

If you don't want to read the whole story, the conclusion is that
using a cyclic file for news does seem worthy of further
investigation.


Test scenario
-------------

The whole purpose of these tests is to determine the potential I/O
savings associated with writing article and overview data to a cyclic
file as compared to the way INN and other news systems do it.

Whilst I refer to INN all the way through this post, it really refers
to the Unix File system and how it deals with storing news as lots of
files within lots of directories.

The testbed consists of a rerunable NNTP feed of articles sent to a
standard issue INN as well as at a simplistic nntp program that uses
the cyclic file system to write articles and NOV data.

The test server is a Solaris 2.5 x86 with plenty of memory and CP. The
test disk is a moderate speed Seagate connected to a PCI SCSI
controller.  The server is otherwise largely idle during the
test. Generally speaking, the specific server details are irrelevant
as these results are all about comparisons.

When INN is running, both the articles and the overview files are
written to the test disk while logs, active and history are written to
another disk.

When the test nntp program is running, the cycle files (3 of them) are
placed on the test disk. The program doesn't have a history file or an
active-flush mechanism, nor does it log per article.

A random selection of 7000+ articles spread across 2800+ groups were
taken from an outbound batch file from our main news server. It turns
out that the total article size of this batch is about 23M with an
average article size of 3.3K, which is a little higher than average.


The test batch is sent from a separate server using nntplink across a
lightly loaded 10Mbs ether (more on this later). The batch is sent
twice to each program. On the first run, the respective databases are
completely empty, ie in INNs case there is (effectively) nothing in
/var/news.

On the second run, the respective databases created from the first run
are used as a starting point. Thus for INN, the directories already
existed and the .overview files are already present etc. (I wipe the
history file to make this second test work for INN). For the cyclic
system this means that earlier NOV blocks have already been allocated
forcing read/write operations to append the NOV data.

The second test is probably closer to the steady-state of a news
system, though the directory and .overview hits are no doubt
artificially high.

The whole set of tests are run a couple of times to confirm numbers
and look for anomalies. Also the tests are run with the batch sorted
and unsorted.

The measurements appear to be consistent within about 5%


What was measured
-----------------

Measurements taken are pretty crude and thus fuzzy.  The iostat prog
is used before and after each run to calculating physical I/O to the
disk. The date command measures elapse time and the usual Unix utils
count log entries, measure disk usage, etc.  All pretty rough I admit.

More Caveats
------------

This is only a test of write capability which is probably where a
cyclic file has the biggest advantage. INN is further disadvantaged as
it has real overhead associated with maintaining an active and history
file as well as feeding overchan. Furthermore the second disk
containing these file is located on the same controller, so results
need to be discounted a bit to take all this into account.

A second caveat is that the Solaris UFS may be much worse that many
other implementations out there.

The final caveat is that there may be a dirty great big gaping hole in
my logic, either in the cyclic code or in the measurements -
especially in light of the results.


Results - part one (unsorted batch)
-----------------------------------

In this set of tests, the batch is presented in random order to
nntplink thus the receiving end has little opportunity to win from any
locality hits.

             +---------------------------------------------------+
             | INN run1   | INN run2   | Cycle Run1 | Cycle Run2 |
+------------+------------+------------+------------+------------+
| Seconds    |    2330    |    2772    |    759     |    832     |
+------------+------------+------------+------------+------------+
| Disk used  |     33M    |    +30M    |    37M     |   +27M     |
+------------+------------+------------+------------+------------+
| Phys Reads |     33K    |     42K    |   6.6K     |   9.2K     |
+------------+------------+------------+------------+------------+
| Phys Writes|     76K    |     64K    |  10.6K     |  11.7K     |
+------------+------------+------------+------------+------------+
| arts/sec   |     3.1    |     2.6    |    9.3     |    8.5     |
+------------+------------+------------+------------+------------+
| reads/sec  |    14.2    |    15.2    |    8.7     |   11.0     |
+------------+------------+------------+------------+------------+
| writes/sec |    32.6    |    23.1    |   13.9     |   14.1     |
+------------+------------+------------+------------+------------+


This looks encouraging. Cycles issue less than 25% of the read-rate
and around 15% of the write-rate of INN. The article rate of 3 times
is also good. A physical write-rate of 1-2 per article is also within
expectations (a block is only written when full and a block is 4K).


Results - part two (sorted batch)
---------------------------------

In this set of tests the batch is sorted by path which gives the
receiver every opportunity to benefit from locality hits. What I want
to do here is wind up the systems to see if I can encourage them to
perform optimally. I want to determine the best article rate per
second that they could sustain on a single spindle.


             +---------------------------------------------------+
             | INN run1   | INN run2   | Cycle Run1 | Cycle Run2 |
+------------+------------+------------+------------+------------+
| Seconds    |    1242    |    1424    |    476     |    505     |
+------------+------------+------------+------------+------------+
| Disk used  |     33M    |    +30M    |    37M     |   +27M     |
+------------+------------+------------+------------+------------+
| Phys Reads |      5K    |     12K    |   1.1K     |   3.9K     |
+------------+------------+------------+------------+------------+
| Phys Writes|     54K    |     41K    |   4.6K     |   6.1K     |
+------------+------------+------------+------------+------------+
| arts/sec   |     5.7    |     5.0    |   14.9     |   14.0     |
+------------+------------+------------+------------+------------+
| reads/sec  |       4    |     8.4    |    2.3     |    7.7     |
+------------+------------+------------+------------+------------+
| writes/sec |      43    |    28.7    |    9.6     |   12.1     |
+------------+------------+------------+------------+------------+

This likewise looks pretty encouraging. Cycles issues less than 25%
of the read-rate and just 10% of the write-rate of INN. The article
rate of 2-3 times is also encouraging but doesn't quite gel with the
reduction in I/O rate.

I got to wondering about the relatively low rate of I/O per second for
the cycle file system. If INN could push the disk into 30+ I/O per
second, why was Cycle only doing 10-20 per second?

Then it dawned on me - the sending system was probably maxing out. If
this was the case then I needed to push the cycle system harder to get
a true max article rate. This I did with a nntplink running on the
same server over loopback. These are the results I got:


             +-------------------------+
             | Splat Run1 | Splat Run2 |
+------------+------------+------------+
| Seconds    |    235     |    270     |
+------------+------------+------------+
| Disk used  |    37M     |   +27M     |
+------------+------------+------------+
| Phys Reads |   1.1K     |   2.3K     |
+------------+------------+------------+
| Phys Writes|   5.7K     |   6.0K     |
+------------+------------+------------+
| arts/sec   |   30.2     |   26.2     |
+------------+------------+------------+
| reads/sec  |    4.7     |    8.5     |
+------------+------------+------------+
| writes/sec |   24.0     |   22.2     |
+------------+------------+------------+

Which is looking better at 20-30 I/O per second with an article rate
of 25-30/second. I think the reason it doesn't go higher is NNTP
latency rather than the disk maxing out. So, if these figures are
correct, then a single SCSI disk looks to be capable of storing 20+
articles per second.


Results - don't forget expire
-----------------------------

One last thing that hasn't been taken into consideration yet is
expire. Cyclic files don't have an expire process, so we really should
add in the expire costs to the above INN tables. I won't do that for
now, but to give a feel for the sort of costs involved, an rm -rf of
/var/news with the 7100 test articles plus overview produced this:


             +------------+
             | "expire"   |
+------------+------------+
| Seconds    |    360     |
+------------+------------+
| Phys Reads |    10K     |
+------------+------------+
| Phys Writes|    55K     |
+------------+------------+
| reads/sec  |   27.7     |
+------------+------------+
| writes/sec |    152     |
+------------+------------+

Yikes that looks like a lot of work.


Some other technical details
----------------------------

This particular Cycles configuration is set to write into 3 large UFS
files, so the OS is obviously buffering the I/Os. Also Cycles has a
small disk I/O cache (20-40K) as that really helps it a lot! Cycles
always writes in 4K block sizes - hopefully this is convenient for the
OS.


Conclusions
-----------

It seems like it might be worth getting a few more measurements and
possibly bolting the cyclic library into the bottom end of INN to get
some real-life experiences.


Regards.

Technical Details
Message-ID: <4kc0g0$15p@bushwire.mira.net.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <4kc0g0$15p@bushwire.mira.net.au>
Subject: cyclic news file system - tentative performance results
Date: Tue, 09 Apr 1996 00:00:00 +0000
From: Mark Delany <markd@mira.net.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 146424273
Organization: Werple Internet, Melbourne
Newsgroups: news.software.nntp