Kbase P46896: Why Older Unix database used many small extents.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  20/10/2003 |
|
Status: Unverified
GOAL:
Why many Smaller Extents were used on older UNIX implementations?
GOAL:
Older UNIX Implementations Optimized using 300-500meg extents?
GOAL:
This solution discusses maximization of access to database blocks under UNIX.
FACT(s) (Environment):
UNIX
FIX:
Even at the size of the smallest databases (the Progress Version 6 demo.db is 352KB for example), access to database blocks requires double-level indirection through the inode.
In the following table, the Blksz (block size) is determined at the time the file system is set up. The figures in the remaining columns mean that you can address up to that particular size before you spill over into another level of indirection.
Blksz Direct 1st-indirect 2nd-indirect 3rd-indirect
1K 12K 256K 64MB 16GB
2K 24K 1M 512MB 256GB
4k 48K 4M 4GB
8k 96K 16M 32GB
A 500 MB extent on a 8K file system, for example, requires double-level indirection to access a database data block. Since most systems are typically 2K block size, a 500MB extent is still in the double-level indirection range. By the same token, so is 200MB and 300MB.
Because each database extent requires an open channel, and opening channels is perhaps the most time consuming operation on the system determine if:
- If there are enough available channels per process (a kernel parameter).
- If it is ok for the box to take a little longer to bring the servers.
If answer is "yes," go with smaller file extents and enjoy better performance accessing blocks and records.
With today's databases in the 500MB to 20GB range, it is unlikely that the system can open that many channels. Consequently larger extents will be required, but fewer of them. Most databases are running with double-level indirection. The trick is to avoid triple-level indirection.
note: Modern UNIX filesystems generally have a default filesystem block size of 4k or 8.
Many of them, like VxFS and JFS, use a completely different allocation scheme that has little in common with what is said as above. From the standpoint of filesystem performance, extent sizes of up to 2GB are fine, even on UFS filesystems.
You may also want to use smaller extents to have even number of extents, allowing them to be separated on each disk to make the i/o loading the same on all the drives that have data extents.