Operating System Configuration

From InterBase
Jump to: navigation, search

Go Up to Database and Server Performance

After you have equipped your server hardware appropriately, you should spend time tuning your operating system for server performance.

Disabling Screen Savers

Screen savers can have a serious impact on the performance of a server. Because servers are often set aside in a machine room, it is easy for the performance impact of a screen saver to be overlooked. Screen savers demand a surprising amount of CPU resources to run, and these programs run continuously, 24 hours a day.

Screen savers are evasive in their ability to disappear when a database administrator logs in to the console to diagnose a mysterious drop in performance. The server seems responsive to the database administrator as soon as she touches the server, but the speed degrades soon after she leaves the server.

Not all screen savers have the same performance cost. The Windows OpenGL screen savers perform continuous floating-point computations to draw three-dimensional shaded shapes in real time. They demand up to 90% of the system CPU, and cause InterBase and other services to slow to one-tenth their normal speed.

The Windows Marquee screen saver is one of the least demanding ones, especially when it is configured to pass text across the screen slowly. Some system administrators like to configure a Marquee on each screen in the machine room, to display the hostname of the respective machine. This becomes a machine-name label, in raster form.

A screen saver can also be entertainment, but these should be reserved for workstations. A server in a machine room should be unattended, not used as a workstation.

If you must have phosphor burn protection for a monitor that you leave on, get an Energy Star approved monitor that has a power conservation mode. This mode blackens the screen after a configurable period of idleness. This not only protects against phosphor burn, but it conserves power. This is like a simple black screen saver, but it is handled by the electronics of the monitor, instead of by software.

The best option is to simply turn off the monitor when you are not using it. This saves the phosphors, saves electricity, and decreases the amount of heat in the machine room.

Console Logins

Do not leave the console logged in on a Windows database server. Even if the desktop is idle, it might use as much as 30 percent of the CPU resources of the machine just maintaining the interface. You should log out of the console of the server when you are not using it. IBConsole enables you to perform most InterBase maintenance and monitoring tasks from another workstation, without logging in at the server’s console of the server.

Sizing a Temporary Directory

When you configure a temporary directory (see Managing Temporary Files), choose a location that has plenty of free disk space. For some operations such as building an index, InterBase can use a great deal of space for sorting. InterBase can even use an amount of space up to twice the size of your database.

The effects of insufficient temporary space include rapid virtual memory page faults, called thrashing, which causes a dramatic performance penalty. Another possible effect is a series of “I/O error” related messages printed to the interbase.log file on the server.

Use a Dedicated Server

Using a server for both workgroup file and print services and as a database server is like letting another user play a video game on your workstation. It detracts from the performance of the workstation, and it is not the intended use for the machine.

Use a secondary server as the file and print server, and a new machine for the database server. Alternately, use the secondary server for InterBase, depending on the relative priority of these tasks – the database server benefits from having a dedicated machine, even if it is not the fastest model available. Whatever is the most important service should be given the best machine as dedicated hardware.

If performance is a high priority, you can spend money more effectively by buying a dedicated machine instead of trying to increase resources such as RAM on a machine that is providing another competing service. Compare the cost of the hardware with the cost of having less than maximum performance.

Similarly, it is best to put a database on a dedicated drive, so that the database I/O does not compete with the operating system virtual memory paging file or other operating system I/O. See Making Drives Specialized.

Optimizing Windows for Network Applications

It is recommended to set the Windows server to optimize for network applications. Without this setting, you might see the CPU usage of InterBase peak for a few seconds every InterBase server is configured by default to give priority to filesharing services. You can change this configuration on the server: Control Panel>Network>Services>Server. In the Optimization panel, choose Optimize Throughput For Network Applications.

This change can result in a dramatic improvement of performance for InterBase, as well as other services.

Understanding Windows Server Pitfalls

Windows servers have a peculiar way of balancing processes on SMP machines. If a process is exercising one CPU and the other CPU is relatively idle, Windows NT tries to switch the context of the process to the less burdened CPU. On a dedicated database server, the ibserver process is likely to be the only significant user of CPU resources. Unfortunately, Windows still tries to reassign the context of the process to the other CPU in this case. Once Windows has moved the ibserver process to the idle CPU, the first CPU becomes less burdened. The Windows server detects this and tries to move ibserver back to the first CPU. The second CPU becomes less burdened. This continues many times per minute, and the overhead of switching the process context between the CPUs degrades performance.

There are several possible solutions:

  • Run ibserver on an SMP server that has enough other duties to occupy the other CPU.
  • Run ibserver only on a single-CPU machine.
  • Assign CPU affinity to the ibserver process:
a. Launch the Task Manager.
b. Highlight the ibserver process.
c. Right-click to raise a window that includes CPU affinity settings.

This technique works only if you run ibserver as an application, not as a service. If you run InterBase as a service, you must use the Windows API to programmatically set the CPU affinity of the ibserver process.

On some operating systems, using a RAM disk is a technique for forcing very heavily used files to be in memory, but still allow them to be opened and closed like any other file. If you consider using a RAM disk on Windows, be aware that the Microsoft RAM disk utility for Windows uses paged memory to allocate the RAM disk. The RAM disk itself can be paged out of RAM and stored on the physical disk in pagefile.sys. Therefore, it is futile to use a RAM disk on Windows to create a high-performance file system.

Advance To: