home *** CD-ROM | disk | FTP | other *** search
-
-
- DISKBUF
-
- A Program to Optimize the BUFFERS= Setting
- Version 2.00(2)
-
- by
-
- W. G. Madison
-
-
- Copyright 1987, '89
- W.G. Madison and Associates, Ltd.
- All rights reserved.
-
-
- November 1, 1989
-
-
- NOTICE: The program DiskBuf and this associated documentation are
- copyrighted products. They may be freely distributed, provided
- only that both the program and documentation are distributed
- together, that no modification is made to either the program or
- the documentation, and that no charge other than a copying charge
- not to exceed $6.00 is levied on the recipient. Disk distributors
- may include promotional text with this program, provided that
- such text appears as a separate file or as text appended to this
- documentation. If appended to this document, such text must be
- readily identifiable as to its source and must appear ONLY at the
- end of the document file. Finally, neither the author nor MADISON
- AND ASSOCIATES assume any responsibility or liability for actual
- or consequential damages arising from the use of this program,
- even if they have been notified in advance of the possibility of
- occurrence of such damages.
-
- We would like to know of your experience with DiskBuf. Please
- address any criticisms or comments to:
-
- W.G. Madison and Associates, Ltd.
- Consultants / Information Systems
- P. O. Box 898
- Greenbelt, MD 20770
- (301)552-7234
- (CompuServe 73240,342)
-
-
- * * * * * * * * * * * * * * * * * * * * * * * * *
-
-
- Acknowledgment: Release 1 of this program was based upon ideas
- gleaned from the public domain program THRASHER, by Monte Fergu-
- son of Ravenna, OH. This release, 2.00(2), has been enhanced as a
- result of several user suggestions received over the intervening
- two years. My thanks to all who have contributed.
-
-
-
-
- 1
-
-
-
- Disclaimer: This program is provided AS IS, with no claim for
- suitability for any particular purpose. Specifically, since the
- program is necessarily extremely disk intensive and therefore
- exercises the head positioning mechanism far more than is custom-
- ary in normal use, the Author and W. G. Madison and Associates,
- Ltd. disclaim any and all responsibility for actual and/or con-
- sequential damages to hardware and/or files resulting from the
- use of this program.
-
-
- INTRODUCTION:
-
- All personal computers using the DOS operating system (PC-
- DOS, MS-DOS, etc.) use buffered I/O when reading from or writing
- to the disk, unless the programmer who wrote the software being
- used went to great lengths to avoid it. The number of buffers
- used is specified in the file CONFIG.SYS, which is read at the
- time the computer is booted up.
-
- If you are not familiar with the CONFIG.SYS file or with the
- concept of buffered I/O, it is strongly suggested that you refer
- to your DOS reference manual before proceeding further.
-
- The problem of determining the proper number of buffers with
- which to configure a DOS computer is, at best, inadequately add-
- ressed in most DOS reference manuals. Generally, the suggested
- approach is "Try a number, then use your computer, then try
- another number. Keep repeating this process until you are either
- fed up or have arrived at something which gives acceptable per-
- formance." Some reference manuals give a suggested value to be
- used by those looking for an easy out. This suggested value may
- or may not yield performance which is close to optimum.
-
- DiskBuf provides a method for scanning through an entire
- range of values while you go out for coffee (or something
- stronger).
-
-
- WHY WORRY ABOUT THE NUMBER OF BUFFERS?
-
- As might be expected, buffering uses RAM. Specifically, each
- buffer added to a DOS system uses 33 paragraphs (528 bytes) of
- RAM. Assuming that plenty of RAM is available, it might be tempt-
- ing to take the approach, "Let's just set the number of buffers
- way up, and fly with that." Unfortunately, one can reach the
- point where more time is spent searching buffers for information
- than is necessary or desirable. A point of diminishing returns is
- reached.
-
- Similarly, too few buffers will cause the computer to go to
- the disk more often than necessary. And, since disk operations
- are dreadfully slow in comparison to memory operations, unaccept-
- able performance degradation will result.
-
-
-
-
- 2
-
-
-
- WHY USE THE DISKBUF PROGRAM TO SOLVE THE PROBLEM?
-
- Basically, without an intimate knowledge of the insides of
- DOS plus a penchant for solving complex mathematical problems,
- there are three feasible methods for attacking the problem. The
- first is to pick a number (based either upon your liking for
- indulging in Russian roulette, or upon recommendations from
- friends or the DOS reference manual) and put your trust in the
- tooth fairy as to the appropriateness of the number. The second
- is to try to determine the number by systematic trial and error,
- editing your CONFIG.SYS file over a period of time. The third
- method is to set up an automatic process which can sweep through
- a series of values, perform a realistic test with each value, and
- record the results for later analysis.
-
- The DISKBUF program permits this third approach to be taken
- easily. By using DISKBUF, you can readily determine the optimum
- number of buffers to be used, based not only upon time to perform
- the test but also upon the amount of RAM occupied by the buffers.
- You can decide, and have some rational basis for the decision,
- whether you are willing to sacrifice X bytes of additional RAM in
- order to gain an additional Y% performance improvement from your
- disk operations.
-
- Sure beats flying by the seat of the pants, no?
-
-
-
- HOW DO I USE DISKBUF?
-
- Seven files are included in the file DISKBUF.ZIP. They are,
- respectively:
-
- DISKBUF.DOC (This file)
- DISKBUF.EXE (The operational program)
- AUTOEXEC.BAT (A specimen AUTOEXEC file)
- BUFTST-1.EXE (One of the two provided test modules.
- This is the test you would probably want
- to use if your typical activity involved
- accessing many files scattered over the
- disk.)
- BUFTST-2.EXE (The second of the two provided test
- modules. This is the test you would
- probably want to use if your typical
- activity involved random accessing of a
- relatively few large files.)
- BUFFTEST.EXE (A copy of BUFTST-1.EXE. This copy is
- the one which will actually be used in
- testing.)
- PLOTBUF.COM (The program to produce a screen plot of
- the test results. Assumes a CGA card.)
-
- Examine the AUTOEXEC.BAT file. You will see, as the last
- line of the file, the line invoking DISKBUF. In the REMark lines
- preceding this, you will see guidelines for setting the switch
-
-
- 3
-
-
-
- values to be passed to DISKBUF. The switches are:
-
- /TARGET= (Sets the disk to be tested)
- /MAXBUF= (Sets the stopping point (maxi-
- mum number of buffers) for the
- test)
- /MINBUF= (Sets the starting point (mini-
- mum number of buffers) for the
- test)
- /PLOT (If present, a screen plot of
- the test results will be pro-
- duced)
-
- The first two switches, /TARGET= and /MAXBUF= are required;
- the other two, /MINBUF= and /PLOT are optional.
-
- /TARGET=xx takes as an argument a valid disk device
- designator, with the appended colon being optional. This deter-
- mines the device or partition which is to be tested. (Required)
-
- /MAXBUF=nn takes as an argument an integer between 1 and
- 99, and determines the greatest number of buffers to be used in
- the test. (Required)
-
- /MINBUF=nn also takes as an argument an integer between
- 1 and 99, and determines the starting number of buffers to be
- used in the test. If this switch is omitted, a starting value of
- 3 will be used. (Optional)
-
- /PLOT determines by its presence or absence whether
- or not a screen plot of the test results will be produced at the
- completion of the test. NOTE: If your computer does not have a
- graphics card, this switch must not be included! (Optional)
-
-
- To use DISKBUF, the following steps are required.
-
- STEP 1. Format a floppy disk using the /S switch to make
- the disk bootable.
-
- STEP 2. Edit the AUTOEXEC.BAT file provided with the
- DISKBUF distribution set, to invoke DISKBUF with the switch set-
- tings you want used.
-
- STEP 3. Copy the edited AUTOEXEC.BAT file and the program
- file DISKBUF.COM onto the disk prepared at Step 1.
-
- STEP 4. Copy your own CONFIG.SYS file onto the disk
- prepared at Step 1. If necessary, edit the CONFIG.SYS to make
- sure that the BUFFERS= parameter is ***OUTSIDE*** the range
- determined by the MAXBUF= and MINBUF= parameters in the
- AUTOEXEC.BAT file. (For that matter, if you simply delete the
- BUFFERS= line from the CONFIG.SYS file, DISKBUF will manage it
- appropriately.)
-
-
-
- 4
-
-
-
- STEP 5. Copy any device drivers to be installed by the
- CONFIG.SYS over to the floppy. Do the same for any resident
- programs to be installed by the AUTOEXEC.BAT.
-
- STEP 6. Copy DISKBUF.EXE to the floppy. If /PLOT is
- selected in the AUTOEXEC.BAT, copy PLOTBUF.EXE to the floppy.
-
- STEP 7. Decide, based on the descriptions given above,
- which of the two test modules you wish to use. Copy the desired
- module to the floppy as BUFFTEST.EXE using the DOS COPY command.
- (For the average user, we believe that BUFTST-1.EXE more nearly
- reflects typical usage; it is therefore the one already set up.)
-
- STEP 8. Re-boot your computer.
-
- STEP 9. Go to lunch, and come back in an hour or so.
- (Optional)
-
-
- When the test is completed, two new files will be on the
- floppy disk:
-
- BUFFERS.RPT contains the test results, giving for
- each number of buffers tested a figure
- of merit and the minimum requirement
- of RAM (in bytes) for DOS.
- BUFFERS.PLT contains information used by the pro-
- gram PLOTBUF.COM. Specifically, each
- line contains the number of buffers
- tested and the figure of merit.
-
-
- The figure of merit for a given number of buffers is propor-
- tional to the time required for the test. Thus, SMALLER is
- BETTER. The minimum figure of merit is the one you want (ignoring
- the amount of space occupied by the buffers).
-
- Note that, if /PLOT was selected, the screen plot only dis-
- plays a limited range of the figure of merit values. Specific-
- ally, the range displayed is from the minimum figure of merit to
- 5% greater than this value. All figures of merit greater than
- this are clipped at this level for plotting purposes. This was
- done in order to better present the detail of the values only
- slightly worse than the minimum value.
-
- The screen plot may be recreated at any time by running
- PLOTBUF. The only restriction is that the file BUFFERS.PLT must
- be in the current disk and directory.
-
- Should you wish to test against two different disks, the
- files BUFFERS.* must be copied or renamed before the second test
- is conducted. If this is not done, the files will be over-written
- and the results of the earlier test will therefore be lost.
-
-
-
-
- 5
-
-
-
- Should you wish to re-test the disk using the other provided
- test, simply return to Step 7 above and proceed from there. It
- will not be necessary to edit the CONFIG.SYS file, since (unless
- you are also increasing the MAXBUF= setting in the AUTOEXEC.BAT
- file) the BUFFERS= setting is guaranteed to be outside the
- testing range.
-
-
- HOW CAN I DESIGN MY OWN TEST MODULES?
-
- Two fundamentally different test modules are provided which
- represent quite different testing scenarios.
-
- BUFTST-1.EXE examines the directory entry for each file in
- every directory on the disk being tested. Thus, it simulates a
- situation in which the user is accessing many files in any given
- session.
-
- BUFTST-2.EXE writes a single large (1000 record, 100 bytes
- per record) file in the root directory of the target disk. It
- then interchanges record 1 with record 1000, record 2 with record
- 999, etc. Having completed this sub-test, it then interchanges
- record 1 with record 2, record 2 with record 3, ... record 999
- with record 1000. Thus, it simulates both sequential and random
- usage of large files.
-
- You are free to generate your own tests as you will. These
- tests can be implemented in either executable (.EXE or .COM)
- files, or in batch control (.BAT) files. In either case, the file
- name **must** be BUFFTEST (i.e., BUFFTEST.COM, BUFFTEST.EXE, or
- BUFFTEST.BAT). The test module must expect a single command line
- parameter of the form <d>:\ where <d> is the drive letter of the
- drive to be tested.
-
- One word of caution. It is important that the operations
- being performed be exactly duplicated from run to run, if the
- output data are to accurately reflect your system behavior. Thus
- if you have, e.g., put together a batch file (BUFFTEST.BAT) which
- performs a MAKE, it is important that you recognize ahead of time
- just which files will be created as a result of the MAKE, and
- delete them prior to terminating your BUFFTEST.BAT.
-
-
- HOW DOES DISKBUF DO ALL THAT GOOD STUFF?
-
- When DISKBUF is invoked, it performs the following
- steps:
-
- STEP 0. Read and parse command tail. Set operating par-
- ameters, based on the contents of the command tail.
-
- STEP 1. Edit the file CONFIG.SYS on the floppy disk.
-
-
-
-
-
- 6
-
-
-
- STEP 1A. If the BUFFERS= line is present, read it to
- extract the current BUFFERS= setting.
-
-
- STEP 1A1. If this setting is not between MINBUF
- and MAXBUF then re-write CONFIG.SYS with a
- BUFFERS= setting equal to the value of MINBUF,
- and go to STEP 1C.
-
- STEP 1A2. If the setting is between MINBUF and
- MAXBUF then go to STEP 2.
-
- STEP 1B. If not present, append a BUFFERS= statement
- with a BUFFERS= setting equal to the value of MINBUF.
-
- STEP 1C. Delete the BUFFERS.* files if they are pres-
- ent, and re-boot the system.
-
- STEP 2. Start the timer.
-
- STEP 3. Perform the selected test.
-
- STEP 4. Stop the timer.
-
- STEP 5. Calculate the figure of merit, and append a record
- to BUFFERS.RPT. Also append a record to BUFFERS.PLT.
-
- STEP 6. Check the current setting of BUFFERS= against the
- value of MAXBUF.
-
- STEP 6A. If buffer setting < MAXBUF, re-edit the
- existing CONFIG.SYS file, incrementing the buffer set-
- ting and re-boot the system.
-
- STEP 6B. Otherwise, the test is completed.
-
- STEP 6B1. Leave the CONFIG.SYS file on the floppy
- disk with a BUFFERS= setting at MAXBUF + 1.
-
- STEP 6B2. If /PLOT is selected, plot the test
- results.
-
- STEP 6B3. Exit to DOS.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 7
-
-