MySQL 您如何确定服务器所需的硬件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/359384/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do you determine the hardware needed for a server?
提问by Agusti-N
I would like to know how do you determine the hardware needed for a server?
我想知道您如何确定服务器所需的硬件?
I have a DB Server running MySQL, and now I want to buy a server, but I don't know what hardware specification that I need. This is a server for a hosting a web page.
我有一台运行 MySQL 的 DB Server,现在我想购买一台服务器,但我不知道我需要什么硬件规格。这是用于托管网页的服务器。
EDIT:The software it's just MySQL Server
编辑:该软件只是 MySQL 服务器
回答by Guy
It all depends on how much load is expected on the application. But as a minimum, I'd go for 2 x cpu or multi-core single cpu, at least 4GB RAM and a decent RAID controller. Depending on your performance and storage requirements - I'd start off with RAID 1 (Mirror) and extend that to RAID 10 (Mirrored stripes) across everything (SAME - Stripe and Mirror Everything).
这完全取决于应用程序的预期负载量。但至少,我会选择 2 x cpu 或多核单 CPU、至少 4GB RAM 和不错的 RAID 控制器。根据您的性能和存储要求 - 我会从 RAID 1(镜像)开始,然后将其扩展到 RAID 10(镜像条带)(SAME - Stripe and Mirror Everything)。
Get some decent network points too.
也获得一些不错的网络积分。
That should at least give you enough headroom if you need to expand.
如果您需要扩展,那至少应该为您提供足够的空间。
回答by Gary Richardson
Databases can be tough to size. CPU speed usually isn't key, but if it's a parallel work load, more cores is better. Lots of memory and fast disks are usually key. It's not uncommon to see 16 or 32GB of memory in a MySQL server now. Of course, that doesn't make a lot of sense if your data set is only 2 or 4GB.
数据库的大小可能很难。CPU 速度通常不是关键,但如果是并行工作负载,内核越多越好。大量内存和快速磁盘通常是关键。现在在 MySQL 服务器中看到 16 或 32GB 的内存并不少见。当然,如果您的数据集只有 2 GB 或 4 GB,这没有多大意义。
If you can afford enough RAM to put your whole data set in memory (not ram disk, but having the database cache it), get that much RAM. This isn't necessarily a good long term strategy if you expect your data to grow substantially.
如果您有足够的 RAM 将整个数据集放入内存(不是 ram 磁盘,而是让数据库缓存它),请获得足够的 RAM。如果您希望数据大幅增长,这不一定是一个好的长期策略。
If your data size is larger than the amount of RAM you can afford, you can try to compensate with faster disks and using more smaller disks (8 x 74GB instead of 4x 136GB).
如果您的数据大小大于您可以承受的 RAM 量,您可以尝试使用更快的磁盘和使用更多更小的磁盘(8 x 74GB 而不是 4x 136GB)来补偿。
You can get some ideas about performance by taking hardware that you have now (assuming you don't have large servers kicking around) and running a scaled down benchmark with some sample data. That should give you an idea of where your bottlenecks are and where you need to spend more cash.
您可以通过使用您现在拥有的硬件(假设您没有大型服务器)并使用一些示例数据运行按比例缩小的基准测试来获得有关性能的一些想法。这应该让您了解您的瓶颈在哪里以及您需要花更多现金的地方。
If you're working with a large vendor (Dell, HP, Sun, IBM, etc), you can ask if they'll send a demo unit with the specs your considering. That way, you can run your benchmarks before you buy the equipment.
如果您与大型供应商(Dell、HP、Sun、IBM 等)合作,您可以询问他们是否会发送带有您考虑的规格的演示单元。这样,您就可以在购买设备之前运行您的基准测试。
And finally, if this is your first database server for the app and you have no idea if it's going to be successful, don't worry too much. If you start with a 'low end' server and your app is successful, you can easily forklift upgrade to a beefying server.
最后,如果这是您的应用程序的第一个数据库服务器,并且您不知道它是否会成功,请不要太担心。如果您从“低端”服务器开始并且您的应用程序成功,您可以轻松地将叉车升级到强大的服务器。
回答by Patrick Cuff
One way is to model your system and simulate your expected load. There are some tools that can do this sort of discrete event simulation:
一种方法是为您的系统建模并模拟您的预期负载。有一些工具可以进行这种离散事件模拟:
This stuff isn't easy, and the commercial tools will cost ya.
这东西并不容易,商业工具将花费你。
You could also try looking for a benchmark that's close to your expected load and see what systems give you the performance you're looking for. The TPC benchmarkswould be a good place to start.
您还可以尝试寻找接近您预期负载的基准测试,看看哪些系统能够为您提供所需的性能。在TPC基准测试将是一个良好的开端。
Good luck :)
祝你好运 :)
回答by Chopper3
It depends how important your customer's perception is and available budget.
这取决于客户的看法和可用预算的重要性。
If you have little budget I'd add more memory, it's very inexpensive at the moment, especially if you use 4GG modules (the 8GB ones are more than twice as expensive at the 4GB ones where I live).
如果您的预算很少,我会添加更多内存,目前它非常便宜,特别是如果您使用 4GG 模块(8GB 模块的价格是我住的 4GB 模块的两倍多)。
If you have a little more then think about getting a quad-core or dual-quad-core system.
如果您有更多,请考虑获得四核或双四核系统。
If you have a bit more still get a good disk controller, ideally a SAS one with hardware RAID.
如果您还有一点,仍然可以得到一个好的磁盘控制器,最好是带有硬件 RAID 的 SAS 控制器。
If customer perception is paramount then get a HP or IBM with redundant power supplies and all of the above, also consider trunking your NICs too if you can be bothered.
如果客户的看法是最重要的,那么请购买带有冗余电源和上述所有设备的 HP 或 IBM,如果您可能会感到困扰,也可以考虑将您的 NIC 中继。
Best of luck.
祝你好运。
回答by Turnkey
Why not do some load testing on your current development server and base your decisions on that? You will probably find that you can use less than expected on your first server and then scale out if/when the business justifies it.
为什么不在您当前的开发服务器上进行一些负载测试并以此为基础做出决定呢?您可能会发现,您可以在第一台服务器上使用比预期少的资源,然后在业务证明合理时进行扩展。
回答by Galwegian
It depends entirely on the nature of the application(s) it will be hosting, and the load it'll put the server under (now and in the future).
这完全取决于它将托管的应用程序的性质,以及它将使服务器承受的负载(现在和将来)。
When I'm 'spec'ing a server, I always buy the best spec I can afford.
当我对服务器进行“规范”时,我总是购买我能负担得起的最好的规范。
I generally buy quite a standard spec, except for a database server when I try and get the fastest disks I can afford.
我通常会购买相当标准的规格,但当我尝试获得我能负担得起的最快磁盘时,我会购买数据库服务器。
回答by Guy
Another option is not to get a separate server for the DB, but to host the DB on an existing server. There are many different options for this from virtualisation (vmware, xen) or to dedicate a single server as a "back-end database server"
另一种选择不是为数据库获取单独的服务器,而是在现有服务器上托管数据库。从虚拟化(vmware、xen)或将单个服务器用作“后端数据库服务器”,有许多不同的选择
It is unlikely with modern hardware that you will see significant CPU usage on a dedicated server.
对于现代硬件,您不太可能在专用服务器上看到大量 CPU 使用率。
Server sprawl is expensive in the long term. Eventually that server will need upgrading and replacing. If you have to replace a few dozen (or a few hundred) it can be a nightmare.
从长远来看,服务器蔓延的代价是昂贵的。最终该服务器将需要升级和更换。如果您必须更换几十个(或几百个),那可能是一场噩梦。
回答by Karl
It depends on how many hits you will need it to serve. Run the program on an old standard PC if you can, run a profiler and see how much the system is taxed. the MySQL Gui Tools has a Health Monitor that will tell you what percentage the system is being used up. Chances are, youll be fine with any old PC. Unless youre serving a lot or a public site like this one (which counts as serving a lot)
这取决于您需要它来服务多少次点击。如果可以的话,在旧的标准 PC 上运行该程序,运行分析器并查看系统的税收。MySQL Gui 工具有一个健康监视器,它会告诉你系统正在使用的百分比。很有可能,您可以使用任何旧 PC。除非您提供大量服务或像这样的公共站点(这算作大量服务)