Large Database on FreeBSD2006年10月29日 14時19分52秒

Running large DB's on FreeBSD と FreeBSD-stable に投稿された。

質問内容は、

The hardware will be an HP DL385, 2 x dual-core Opterons, 16GB RAM, 7 x 15k rpm disks in a RAID5 setup. ... i know the database will have several million rows and be larger than 10GB.
との事。16GB のメモリと RAID5 のディスクを搭載したサーバに 10GB ぐらいのデータベースを FreeBSD と MySQL で構築したいとのことだ。

すぐ、かつ大量にあった返事が RAID5。RAID5 はデータベースの性能を殺すから、絶対避けるようにとのこと。

こちらも RAID5 程ではないにしろ、いくつかあった同じ意見だ。FreeBSD では MySQL よりも PostgreSQL の方がほぼ全てに置いて優れているらしい。Linux では、

the less-accurate-but-much-quicker gettimeofday() under Linux helps MySQL on that platform versus FreeBSD
との理由で、それほどでもないらしい。つまり、Liunx では gettimeofday() が精度は落ちるが、戻るのが早い為に MySQL のパフォーマンスもそれほど落ちないとのことだ。

PostgreSQL の利点を述べた投稿は以下の通りだ。

- It scales well to multiple CPUs (almost linear, provided your connections are under sufficient load). I've seen benchmarks like this from a 16 CPU Altix (SGI).

- It can do complex queries, and it does them well (I've seen it outperform MySQL regularly - especially where MySQL couldn't perform the query directly).

- Data integrity is very important to the PostgreSQL community, so it doesn't ignore errors or truncate your data or things like that (MySQL does).

- It has a great community; the people on the mailing lists are very knowledgeable and helpful. You'll usually have a solution for a problem within a day.

- AFAIK, the key developers run FreeBSD.

One thing; there are a lot of PostgreSQL vs. MySQL comparisons, but they usually fail to tune both databases properly or test with workloads that have been optimized for MySQL.

CPU が増えても、より効率よく CPU を割り当てることができ、複雑なクエリも MySQL よりも早いらしい。そして、一般的に見る PostgreSQL と MySQL の比較は MySQL 用に最適化したした環境だから PostgreSQL が勝てないだけだと言っている。

60GB のデータベースを運用する構成も投稿された。 FreeBSD と PostgreSQL の最適化の例もあげられた。

なお、データベースの半分以上が実メモリに載るようなデータベースは大きくないそうだ。