Disk Fragmentation Disk Sweet Spots

- 308 - shared library quicker, and so may not be much help in speeding up a running system for example, Norton SpeedStart caches DLLs and device drivers in memory on Windows systems. But you can apply the technique of memory-mapping filesystems directly and quite usefully for applications in which processes are frequently started. Copy the Java distribution and all class files all JDK, application, and third-party class files onto a memory-mapped filesystem and ensure that all executions and classload s take place from that filesystem. Since everything executables, shared libraries, class files, resources, etc. is already in memory, the startup time is much faster. Because it is only the startup and classloading time that is affected, this technique is only a small boost for applications that are not frequently starting processes, but can be usefully applied if startup time is a problem.

14.1.4 Disk Fragmentation

When files are stored on disk, the bytes in the files are not necessarily stored contiguously: their storage depends on file size and contiguous space available on the disk. This noncontiguous disk storage is called fragmentation. Any particular file may have some chunks in one place, and a pointer to the next chunk that can be quite a distance away on the disk. Hard disks tend to get fragmented over time. This fragmentation delays both reads from files including loading applications into computer memory on startup and writes to files. This delay occurs because the disk header must wind on to the next chunk with each fragmentation, and this takes time. For optimum performance on any system, it is a good idea to periodically defragment the disks. This reunites those files that have been split up, so that the disk heads do not spend so much time searching for data once the file-header locations have been identified, thus speeding up data access. Defragmenting may not be effective on all systems, however.

14.1.5 Disk Sweet Spots

Most disks have a location from which data is transferred faster than from other locations. Usually, the closer the data is to the outside edge of the disk, the faster it can be read from the disk. Most hard disks rotate at constant angular speed. This means that the linear speed of the disk under a point is faster the farther away the point is from the center of the disk. Thus, data at the edge of the disk can be read from and written to at the fastest possible rate commensurate with the maximum density of data storable on disk. This location with faster transfer rates is usually termed the disk sweet spot. Some commercial utilities provide mapped access to the underlying disk and allow you to reorganize files to optimize access. On most server systems, the administrator has control over how logical partitions of the disk apply to the physical layout, and how to position files to the disk sweet spots. Experts for high- performance database systems sometimes try to position the index tables of the database as close as possible to the disk sweet spot. These tables consist of relatively small amounts of data that affect the performance of the system in a disproportionately large way, so that any speed improvement in manipulating these tables is significant. Note that some of the latest operating systems are beginning to include awareness of disk sweet spots, and attempt to move executables to sweet spots when defragmenting the disk. You may need to ensure the defragmentation procedure does not disrupt your own use of the disk sweet spot. - 309 -

14.2 CPU