• No results found

Database Hardware Selection Guidelines

N/A
N/A
Protected

Academic year: 2021

Share "Database Hardware Selection Guidelines"

Copied!
26
0
0

Loading.... (view fulltext now)

Full text

(1)

Database Hardware Selection Guidelines

BRUCEMOMJIAN

Database servers have hardware requirements different from other infrastructure software, specifically unique demands on I/O and memory. This presentation covers these differences and various I/O options and their benefits.

(2)

Outline

CPU

Multi-threading

GHz

Pipelining

SMP

NUMA

(3)

Nope!

CPU

Multi-threading

GHz

Pipelining

SMP

NUMA

(4)

Normal Server Priorities

I/O Memory

CPU

(5)

Database Server Priorities

I/O

CPU

Memory

(6)

Why the Difference?

Traditional servers are oftenCPUconstrained because of:

Network overhead (http)

Text processing (email)

Virtual machines (application servers)

Application code

(7)

Database Server’s Unique Requirements

Sequential scans of large tables

Index scans causing random I/O

Unpredictable query requirements

Reporting

These do not require major CPUresources.

(8)

Durability Adds Even More I/O Requirements

ACID(D= durability) requires committed transactions to be stored permanently. Few other server facilities must honor this requirement.

Recovery

fsync

fsync Query and Checkpoint Operations Transaction Durability Backend

Postgres

Backend Postgres

Backend Postgres

PostgreSQL Shared Buffer Cache Write−Ahead Log

Kernel Disk Buffer Cache

Disk Blocks

(9)

Magnetic Disk I/O Stack

fsync

fsync Kernel Disk Buffer Cache

Disk Cache HBA/RAID Cache

PostgreSQL Shared Buffer Cache Write−Ahead Log

Magnetic Disk

write−through

write−back

(10)

Magnetic Disk I/O Stack With BBU

fsync

fsync Kernel Disk Buffer Cache

Disk Cache HBA/RAID Cache

PostgreSQL Shared Buffer Cache Write−Ahead Log

Magnetic Disk

B A T T

write−back

(11)

Flash / NAND Storage I/O Stack

fsync

fsync Kernel Disk Buffer Cache

HBA/RAID Cache

PostgreSQL Shared Buffer Cache Write−Ahead Log

Disk Staging Cache

Flash (NAND) Solid State Disk (SSD)

B A T T

B A T T

?

?

write−back

(12)

DRAM Storage I/O Stack

fsync

fsync Kernel Disk Buffer Cache

HBA/RAID Cache

PostgreSQL Shared Buffer Cache Write−Ahead Log

DRAM Solid State Disk (SSD)

B A T T B A T T

?

(13)

Write-Back vs. Write-Through Caching

Write-back caching returns write success before passing data to lower storage layers

Write-through caching waits for write acknowledgement from lower storage layers before returning success

(14)

Caching Layers

HBA/RAIDcache behavior is usually controlled by the

HBA/RAIDfirmware, often conditionally based on the health of theBBU

Storage drive cache behavior can be set by utility commands or by using certain operating system calls

Enterprise/SASstorage devices usually default to

write-through, while consumer/SATAdevices usually default to write-back

(15)

H

BA

/R

AID

C

ACHING

HBA/RAIDcontrollers often set storage drive caching mode to write-through

With anHBA/RAIDnon-volatile cache, there is little advantage to using write-back mode on storage drives

(16)

Magnetic Disk Selection

More small spindles is better than fewer large spindles

RAID5/6 is too slow for database writes

RAID10 is popular

make sureSMARTreporting is fully supported

SAS/SCSIdisks are usually designed for enterprise workloads, unlikeSATA/ATA

reliability

error reporting

24-hour operation

heat

vibration

http://www.intel.com/support/motherboards/server/sb/CS-031831.htm

(17)

S

SD

s

Flash/NANDvs. DRAM

Write staging area — it is not just cache

Running aNAND SSDin write-through mode can reduce its usable life because of increased write cycles

Best forWALand randomI/O, e.g. indexes

Set random_page_cost = 1.1

Set effective_io_concurrency = 256

Intel SSD 320 Series:

http://blog.2ndquadrant.com/en/2011/04/intel-ssd-now-off-the-sherr-sh.html

(18)

Filesystem Options

xfs or ext4 over ext3

reduce file system logging, particularly for /pg_xlog directory

disable access (atime) recording

(19)

Battery-Backed Unit (

BBU

)

Verify battery or super-capacitor (supercap) existence visually

Typically lasts for 48-72 hours

Some write the cache to local flash memory on power failure

Detected battery/super-capacitor failure can disable write-back cache mode

Requires failure monitoring

Requires replacement

(20)

Battery-Backed Unit (

BBU

)

http://myauctionpics.com/SATA-SAS-RAID-card-Adaptec-4805-256-MB-Cache-with-Battery/gallery/634260433994368750/1

(21)

Battery-Backed Unit (

BBU

)

(22)

Shared Storage

SANandNASreplace direct-attached storage (DAS) with shared storage

Often used for easier storage management

SharedI/Oresource

Databases often wait forI/Ocompletion, meaning they have to contend with shared resource contention

SANserves block devices,NASserves file systems

(23)

RAM

The more RAM, the better; this reducesI/Orequirements

Ideally, five minutes of your working set

The more RAM, the more possibility ofRAMfailure

UseECC(Error Correction Codes)RAM

detect errors

correct errors

report faulty memory

cosmic radiation

(24)

C

PU

s

Parallel query allows a single session to use multipleCPUs

Postgres does not support this

Heavy use of server-side functions might generate significant

CPUload

CPUs can become a bottleneck if the entire database fits in

RAMand the workload is read-only

(25)

Not the Same

Just because something has the same interface doesn’t mean has the same capabilities. Compatible computer hardware is not all

(26)

Conclusion

I/O CPU Memory

http://momjian.us/presentations

References

Related documents

Wenn der Käufer die Waren nicht am vereinbarten Datum abholt oder die bestellten Waren bei Lieferung nicht annimmt, hat der Verkäufer die Wahl zwischen einerseits der Forderung

Microplastics in maui, long term forecast auckland new zealand, are some warnings at the hot weather conditions for the west coast?. Cookies to aaron and long term forecast new

Q: After replacing the cache device or HDD, how does Intel Smart Response Technology prompt the user to start using the Enhanced—Write through, or the Maximized—Write back mode?..

When utilizing RAID 0 mode, the storage controller cache should be disabled—this is configurable on some but not all storage controllers—to ensure that it does not conflict with

With RAID 5, CLARiiON write cache flush operations begin with old data and parity being read from the disk by the storage processor.. What is the

RAID 1+0 configuration of six to eight (6-8) or more 15K SAS drives in a single volume with dedicated Hardware RAID controller with minimum 512MB of cache and battery backup..

For high-performance operation, RAID-based solutions must dedicate the RAID array's cache for log file caching, and must also be operated in write-behind caching mode - which

Changing SATA Emulation from IDE mode to RAID mode is the equiv- alent of connecting the hard drives to a new add-on RAID storage controller.. The installed operating sys- tem on