Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://crydee.sai.msu.ru/ftproot/pub/misc/doc/os2.hints/warp-performance.htm
Дата изменения: Fri Sep 22 17:28:30 1995 Дата индексирования: Mon Dec 24 07:28:49 2007 Кодировка: Поисковые слова: comet |
Some terms and phrases that will be used in this document are as follows:
Warp- OS/2 Warp Version 3.0 both the version that is used with Windows already installed on your machine and the version that includes the WIN-OS/2 support.
OS/2 - Refers to the OS/2 Warp Version 3.0 product and its capabilities.
System - a generic term that refers to computer with an operating system and application programs installed on it.
Memory - The amount of physical memory or RAM ( Random Access Memory) that is installed in the computer or used by a particular function.
Working Set - Is the amount of physical memory used by the operating system or a program to perform a specific function or group of functions. It includes all code and data.
FAT - File Access Table file system.
HPFS - High Performance File System.
Desktop- Sometimes referred to as the Workplace, this means the Workplace Shell feature of OS/2. The Workplace Shell is the part of OS/2 which controls how you OS/2 systems appears on your computers video screen.
There are some basic considerations that need to be made about the computer that you will install Warp on. They break down into 3 elements: processor , memory and disk.
In most cases the processor that you have in your system has a minimal impact on performance compared to the amount of memory and the speed of the disk. The only real considerations to make with respect to processor are its age. You should avoid 386 and 386SX processors. You want processors that can be upgraded and those that support instruction caching sometimes referred to as Level 1 or Level 2 cache. There really is no optimum level instruction cache size. More instruction cache is usually better than less. The only real determinant should be costs.
Memory, also called RAM, is a different story. Without enough memory your system will run slow. If you cannot afford to buy memory for your system, then you must manage the things you install. You should only install fonts, device drivers, objects and applications that you will actually use. You may think that just because you have not started an installed application, it is not using any memory. This is not always the case. Many newer OS/2 applications will register classes and objects with the Workplace Shell or add items into path statements, set statements and the like. Many of these things will cause memory to be used even when the program is not running. In some cases, the program will require special device drivers be installed which will also use up memory.
Other things that affect memory usage are disk caches, CD-ROM caches, multimedia support and buffers. The important factor to consider for the disk cache, is that it is designed for general use. Since most systems are not general use, the disk cache should be tuned to the specific system environment to optimize memory usage. We will discuss the disk cache considerations in more detail when we look at the file system options.
Probably the most important piece of hardware on your system is the hard disk. It will affect the performance of starting your system, loading applications, the speed of applications, and the general performance of your system.
It is best to have a disk subsystem which uses a bus-mastering type of adapter. Many SCSI devices and some of the PCI devices have this capability. These types of devices allow for multiple requests to be sent to the disk device to be processed rather than just one command or function at a time. They also allow what is called scatter / gather capabilities. Without bus mastering, data that is transferred between the computer's memory and the disk must be in contiguous memory, one byte after the other. With bus mastering, the data does not have to be contiguous and does not have to be on a 64K byte boundary. Bus-mastering relieves the system of a lot of overhead and therefore performs faster in actual usage , although you will see little or no difference when running benchmarks. When benchmarks are being run, they tend to be the only thing running in the system and therefore are not competing for memory or other systems resources. Also, buffers, data and code tend to be in contiguous memory and therefore do not require the capabilities that Bus-mastering has to offer.
When the memory in your system is over committed, that is, the operating system and the programs you are running need more memory than is physically available in your computer, Warp will page, or swap, executable portions of the operating system and programs, and data that has not been accessed for a while to the disk in order to make room for the needed code and data. In this instance, the disk is the single most important factor in your system with respect to performance.
Another consideration with regard to the disk is whether or not it has its own caching. If it does and your applications perform mainly sequential disk access, then you can reduce the size of your software disk cache. Hardware disk cache will have little or no effect when the programs perform random disk operations. The hardware cache will improve the performance of starting the Warp operating system and the applications.
The amount of memory you have in your machine should affect the decision about which file system to use. When HPFS is installed, it requires a minimum 200 to 250k of working set, plus the space allocated for its cache. That is, it reduces the amount of physical memory that is available to programs by 200 to 250K. This is a large amount of memory and is the main reason why FAT is used when Warp is installed on a system that contains 4 MB of physical memory..
Regardless of which file system you select, you need to plan for future requirements: How will maintenance and fixes be applied? Where will applications be installed? Where will data reside? etc. I recommend that when you set up your hard disk, you create a minimum of 3 partitions. One will be for the operating system(s), one for your applications and static data files, and another for dynamic data files and temporary files. Decide whether you want to use Boot Manager or Dual Boot. If you select Dual Boot, then OS/2 must be installed with the FAT file system.
For temporary files, it is better to have them preallocated and reuse them rather than create and destroy them every time. Extending a file can be almost twice as slow as just writing to a file. Also, if you reuse files, it will definitely reduce the fragmentation in your disk directories. These types of files can be the ones allocated by programs that you run, or can be files you create to pass information between systems, or processes in your local system.
Now let's look at some specifics with regards to the two file systems.
When Warp is allocating space for a file in a FAT partition, it will look for the largest available free space area to write the data or create the file. If lots of files were created and deleted, or expanded, these free space areas become smaller and smaller and are spread out over the disk. This is referred to as fragmentation. When a file is stored in many areas on the disk, it takes longer to read that data simply because the disk head has to do more seeking.
The FAT file system disk cache is defined by the DISKCACHE= statement in the CONFIG.SYS file. New in Warp is the "D" designation for the size of the disk cache. Each time Warp is booted, it will allocate space for the disk cache based on the amount of physical memory that is installed in the system. If more than 8 MB is installed, 10% of the physical memory will be used for the disk cache up to a maximum of 4 MB. Based on what applications and support you install in your system, this may be too high and cause you to over commit your memory. If there is not a lot of disk work done on your system, or you are using DB/2 or HPFS, then you should reduce the size of your disk cache. A number between 128 and 256K is sufficient for most systems. On a 4 MB system, we set the disk cache to 48K.
The minimum cache size that can allocated is 32K while the largest is 14.4MB. Even if you only use HPFS on your system's disk drives, the FAT cache, along with lazy writing will be used for diskette drives. In this case, you would want to set the minimum FAT cache size of 32K.
In conjunction with the cache size, you should also set the cache threshold. This determines which records being written or read will be placed in the cache. The default is a record size of 2K. What this means is that a record whose size is greater than 2K will not be placed in the cache and will have to be read from the disk device if it is accessed again. The 2K default is good for cache sizes that are less than 128K. If your cache size is 128K or larger, increase this value to at least 16 and preferably 32. More detail about this parameter and the DISKCACHE= statement will be given in the section on CONFIG.SYS.
Some additional items for improving performance using FAT are:
With HPFS, you specify the cache size and the caching record threshold size in the IFS statement in the CONFIG.SYS file. As with FAT, you should specify the size of the largest record that can be placed in the cache (cache threshold value). The /CRECL parameter is used to define this by specifying a number in terms of K bytes. 32K is usually a good starting value. The range can be from a low of 2K to a maximum of 64K and must be expressed in increments of 2K. If it is not, the value will be rounded up to the nearest 2K boundary.
As mentioned earlier, the big drawback to HPFS is the amount of extra memory that it requires. Even if there is no HPFS partition on your system, it will cost between 200 and 250K in working set memory, as well as the space for the HPFS cache. If you are installing Warp on an existing DOS and or Windows system, you should not install HPFS. When your system is up and running, you can check the working set of your system. If there is enough free memory and you wish to create a HPFS partition, then you can use selective reinstall to install the HPFS support. Remember that any data stored in the HPFS partition can not be accessed if you boot your machine under DOS.
Another advantage of HPFS over FAT is in the area of extended attributes (EAs). EAs are data attached to a file and used to provide information about the file they are attached to. For example, the name of an object that appears in an OS/2 folder or on the OS/2 Desktop is stored in EAs. In HPFS, EAs are part of the HPFS file control block which is read when the file is open. In FAT, EAs are stored in a separate file in separate clusters and require additional I/O to access them, and are therefore slower.
OS/2 programs usually run at normal priority, which is 200. Under program control, the program can change its priority to be server class, 300, or time-critical, 800. It can also change its subclass priority between 0 and 31. A thread that has priority 200 and a subclass of 15 has a higher effective priority than a thread with priority 200 and subclass 0, and therefore runs first. All DOS and Windows applications always run at priority 200. In OS/2 Warp, we have added the capability to define the subclass priority for DOS and Windows applications. Care should be taken when using this subclass priority since it may cause other programs to run slower or generate errors in the case of communication applications that do not get the subclass boost.
Warp will give OS/2 threads a priority boost for specific types of functions and states. A priority boost means that the priority of the thread is changed for a given time slice to give it higher priority than other threads. This allows these threads to process more quickly and therefore improve their responsiveness to the user. Following is a list of priority boosts that can be given to a thread. They appear in descending order.
When a thread is in more than one of these states, the system will combine the states and give a priority based on the combined states.
For DOS and Windows applications, the Foreground, Windowed, and keyboard states do not apply. The routine that handles the mouse or keyboard interrupt will receive a boost in priority to handle the interrupt, but the application does not receive a priority boost. If the DOS Setting INT_DURING_IO is specified, a second thread is used to handle the I/O interrupt, and that thread is given an interrupt boost.
Idle class is the other priority class that exists in OS/2. This priority level runs only when nothing else in the system wants to run. Threads in this class will not receive any of the state boosts. If DOS and/or Windows applications are being run, then you should avoid the use of threads that run in idle class because they may never run but will take up system space.
Now let's look at specific things in the CONFIG.SYS file that you can change to affect the performance of your system. First we cover those statements that you should NOT modify unless you have a system which has a special use, such as a process control system. An example would be a system used to monitor a manufacturing machine or chemical process, where timing and response time are critical factors.
You can also specify a COMMIT parameter. This forces the system to ensure that
enough physical memory or swap file disk space is available for a memory object
when it is created. Normally, OS/2 commits physical and disk memory when the
page of memory is actually touched. Specifying this parameter can significantly
increase the amount space your swap file uses on disk. You would usually only
specify COMMIT if you were developing applications or systems and wanted to
see what the maximum amount of memory and disk space that could be required
for your system.
The t parameter is not defined in the default CONFIG.SYS file. It defines the cache threshold for records that go into the cache. The default value is 4. This means that any record that is 4 sectors or less will go into the cache, while those greater than 4 sectors will not. If your disk cache size is 128K or larger, add this parameter to the disk cache statement. If known, set this value to the largest record size used. Otherwise, set the value to 32. The range can be from 2K ( 4 sectors) up to 64K. I chose 32 because it is a good starting point and is big enough to handle most applications and program executable files.
The LW parameter activates the Lazy Write or write behind feature. This allows the application to get control back before the data is actually written to disk. A separate thread will write the data from the cache to the disk when necessary or opportune to do so. You should always use this option, and code your applications to open files with a cache bypass option if disk data security is imperative.
The AC: parameter is used to specify which FAT directories should be checked at system boot time to see if they were left in a unpredictable state when the system was last powered off. This usually occurs when the power is lost to your machine and you had not done a Shutdown or Ctrl-Alt-Del key sequence prior to losing power. The disk directories specified here will have CHKDSK run against them to clean up any lost files or abandoned clusters.
The s parameter specified the size that the swap file is initialized to when you start your Warp system. Make this large enough so that it does not have to grow in size while you are running your programs. You should perform your normal computer functions and look at the size of the swap file when you have the most activity. Then set the value of the s to this size in the CONFIG.SYS file. If you are using the FAT file system, IPL your system under DOS, delete the SWAPPER.DAT file, defragment the disk partition where the swap file will be located, and then IPL your OS/2 system. This should keep your swap file from getting fragmented.
The r parameter specifies the amount of free space that must be in the swap file's drive. The default for this value is adequate and only needs to be changed if you want to be warned earlier about a possible out-of-memory situation.
To determine how many threads you are using at any given time, run the PSTAT command from an OS/2 command line. This will show all of the processes that are running on your system, as well as how many threads each process is using. The output is quite long, so you may want to redirect it to file.
If you use the selectable CONFIG.SYS option in the Archive and Retrieve feature of Warp, it is possible to create multiple CONFIG.SYS files which will contain different device drivers based on your needs. For example, you could create one CONFIG.SYS file that is used for maintenance and installation. This one would include the XDFLOPPY.FLT and both IBMxFLPY.ADD drivers plus additional threads. Another CONFIG.SYS used for normal processing could have these device drivers removed and a lower number of threads. When maintenance has to be applied to the system, or some additional new products installed, you could boot the machine with the Archive and Retrieval menu active and select the proper CONFIG.SYS to be used. An extension of this would be to archive the CONFIG.SYS and the OS/2 INI files and select those to apply maintenance.
If you select Create Archive on system restarts, this will slow down your system's boot time. You want to set this option only when you have changed your desktop and/or configuration and want to save it. Once it has been saved, turn this option off. You can get to the Archive Retrieve menu screen when you boot your machine by using the ALT+F1 key sequence.
All numbers are presented in megabytes of memory unless otherwise noted and indicate all the physical memory that is used to execute a given function. This includes data, the Warp operating system and programs..
All measurements were made on a PS/2 A21, with 26MB of memory, VGA video, ESDI disk, mouse, keyboard and 16/4 Token Ring adapter. HPFS and Multimedia support were not installed in the base system. The CONFIG.SYS file was modified to be equivalent to how it would look on a 4 MB system. DISKCACHE=48, THREADS=96, and no IFS statement for HPFS.
Memory Requirements:
Function OS/2 Warp OS/2 Warp For WIndows With WIN-OS/2 Open System Folder 3.6 MB 3.7 MB Open Command Prompts 3.5 3.6 Start a DOS Session 4.5 4.6 Exit the DOS Session 4.3 4.3 Start a Windows Session 6.3 6.0 Exit the Windows Session 5.3 5.3 Open Productivity Folder 3.5 3.6 Start Enhanced Editor 4.5 4.6
The numbers for DOS and Windows sessions are for full-screen sessions and therefore include the working set memory for switching back to the Warp Desktop to stop the measurement process. Following are numbers for starting a DOS session in a window and the Windows PROGMAN support in a window, also referred to as a seamless session.
Function OS/2 Warp OS/2 Warp For WIndows With WIN-OS/2 Open DOS Window Session 4.16 MB 4.15 MB DIR Command in DOS Window 3.00 3.00
Start PROGMAN 6.17 MB 5.84 MB Open Folder Main 3.51 3.50
Start PROGMAN 5.86 MB 5.69 MB Open Folder Main 3.39 3.35
The above numbers show that how you set up your session can have a significant impact on the amount of memory used.
All above numbers are the amount of total memory used for the particular function.
The next series of numbers shows how much memory is required when the particular support is is installed or activated on your system. These number are presented as Kilobytes ( KB ) in size. For example, Save Desktop costs 300KB in working set memory. So, if the desktop was being saved while the System folder was being opened, 3.9 MB of memory would be required instead of 3.6. The numbers below are in addition to those above.
Support Additional Working Set Memory Multimedia Device Drivers 50 KB Desktop Folder and Objects 100 System Sounds 40 - 300 (Inactive - Active) Save Desktop 300 HPFS 200 - 400 ( No HPFS Partition Defined, and 64 K cache) XDF Support 50 Personnel Communications 3270 Support not started less than 20 Support active Minimum 300 (Single session and does not Maximum 450 include connection protocol) TCP/IP 500 (Base support) This is for the Device Drivers that are installed with the BonusPak. Lan Requester 4.0 1 MB Device Driver and Setup 700 KB Requester Active 300 Default install for Token Ring including LAN Messaging support. STACKER 4.0 150 KB ( Stack Storage and Communications, San Diego, Ca.)