紅薯 選擇 MySQL 用的伺服器硬體設定

來源:互聯網
上載者:User
5 Minute DBA – Database Server Hardware Selection」講了一些幫資料庫選擇硬體的方式,其實是偏向MySQL…

簡單的說,CPU超過8 CPU其實意義不大,不需要買4*4core或是4*6core,因為MySQL目前無法利用到。

記憶體愈大愈好,記憶體現在便宜許多,如果有I/O bound的問題,除了改寫程式外,直接把記憶體加到32GB或是64GB通常是最划算的方法。

硬碟愈快愈好,有Hardware RAID10 (要有電池)會比軟體的RAID10好,不過這主要看需求,如果是CPU bound的應用,說不定SATA硬碟就夠用?

網卡請務必用GigabitEthernet,最好是bounding/trunking,除了增加thoughput外,也可以當作redundant link。然後作業系統一定要選64bits,不然會受限於記憶體可定址空間。

5 Minute DBA – Database Server Hardware SelectionPosted on
March 10, 2009
by Matthew Yonkovit

So you need to purchase a new database server, and you really don’t know where to start..

Because their maybe different recommendations for different OS’s I am going to stick with Linux with these recommendations. I want to say right off the bat here… choosing the right hardware should probably not be a five minute task. I think you really need
to spend time reviewing your application, it’s access patterns, the io capacity, etc. You just can’t do this in five minutes generally. But if your under the gun and asked me to spec something out today… here are some general guidelines.

As of  March 10th 2009 here is what I would recommend ( This are going to change every few months potentially with new versions of MySQL & new hardware:

CPU:
Currently the scalability of Innodb beyond 8 cores is limited, in fact with the current ( unpatched ) releases you may see a performance regression with more then 8 cores. We wrote about this before. If you have the money go with the fastest CPU’s available.
Avoid servers with lots of cores and a lower speeds.

Memory:
The more memory generally the better. Here I would shoot for an amount of memory that will allow 100% of your hot data to be in memory. If you do not know how much data is going to be hot, a good guess in my experience is 10-20% of the total database size ,
but that’s going to vary from application to application.   If you can’t figure out the total host data, more is better or a 20% rule of thumb is better then nothing. Minimally plan for 2-4GB of memory to be allocated to the OS. Typically I want at least 4GB
of memory for the OS, and if I have a really active database I want more ( 8GB+ ). When I say 4GB for the OS, this will also be used for the MySQL Per thread buffers/thread stack, etc. So if you have a 24GB Database and all 24GB is hot or going to be used
frequently I may put in 32GB of memory in my system and allocate 24GB to innodb and reserve the other 8GB for the OS and other items.

Disk:
Disk is going to be a toughy in 5 minutes. You really have two concerns here, Disk capacity & IO Capacity (think io’s per second). Disk capacity is generally pretty easy, I need XGB of disk space… most people can estimate this no problems.  Keep in mind with
RAID you will lose some raw disk capacity ( I.e. 4 160GB drives in a RAID 10 setup will deliver ~320GB of usable space ).  A 5 minute answer to IO capacity is a bit more of a challenge.    One of the descisions  yo will need to make if you can get by with
internal disk or you need a SAN. Just the other day
Peter Z wrote about when to choose a SAN… give it a read. Assuming your making a decision in 5 mintes I am going to make an assumption that your going to look for internal disk.  Purchasing the correct SAN in my opinion requires a lot of thought.  So Let
assume you want to use internal disk. First If all of your data fits into memory, it lessons your disk requirements a bit but it will not eliminate disk IO ( your still going to read and write to disk, but your reads should be lessened ). I strongly urge that
you keep the database and OS completely separate.  So that’s 2 disks for the OS ( mirrored disks should be fine ).  For the database I typically recommend RAID10 for the data ( RAID 5 maybe OK for database with fewer writes, I.e. data warehouses ) which means
a minimum of 4 disks for your database.  So thats 6 disks to start with.  You can then scale up from there  as you need more, without more analysis your going to be guessing here.     In terms of the type of drives, SAS or SCSI in either 10K or 15K speeds
are pretty standard. I would avoid SATA drives that are <10K rpm.  Of course this can all change, because it really depends on your needs and requirements… as I said tough!

Disk Controller:
Cache on your disk controller is important and the more the better in most cases. Make sure your controller has a battery backup, otherwise its really useless.

Network Cards:

Purchase at least two network cards for your system, both full 1GBE. Typically I would bond these two nics together to give some redundancy. Also avoid dropping your new server into a 100Mb/s network as well.

A quick note on the OS… make sure you install a 64 bit OS!

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.