- Mastering Ceph
- Nick Fisk
- 589字
- 2021-07-09 19:55:09
CPU
Ceph's official recommendations are for 1 GHz of CPU power per OSD. Unfortunately, in real life, it's not quite as simple as this. What the official recommendations don't point out is that a certain amount of CPU power is required per I/O, and it's not just a static figure. Thinking about it, this makes sense; the CPU is only used when there is something to be done. No I/O, no CPU is required. This, however, scales the other way, more I/O, more CPUs are required. The official recommendation is a good safe bet for spinning disk-based OSDs. An OSD node equipped with fast SSDs can often find itself consuming several times this recommendation. To complicate things further, the CPU requirements vary depending on I/O size as well with larger I/Os requiring more CPU.
If the OSD node starts to struggle for CPU resource, it can lead to OSDs to start timing out and get marked out from the cluster, often to rejoin several seconds later. This continual loss and recovery tends to place more strain on the already limited CPU resource causing cascading failures.
A good figure to aim for would be around 1-10 MHz per I/O, corresponding to 4 KB-4 MB I/Os, respectively. As always, testing should be carried out before going live to confirm that CPU requirements are met both in normal and stressed I/O loads.
Another aspect of CPU selection, which is key to determine performance in Ceph, is the clock speed of the cores. A large proportion of the I/O path in Ceph is single threaded and so a faster clocked core will run through this code path faster leading to lower latency. Due to the limited thermal design of most CPUs, there is often a trade-off of clock speed as the number of cores increases. High core count CPUs with high clock speeds also tend to be placed at the top of the pricing structure. Therefore, it is beneficial to understand your I/O and latency requirements to choose the best CPU.
A small experiment was done to find the effect of CPU clock speed against write latency. A Linux workstation running Ceph had its CPU clock manually adjusted using the userspace governor. The following results clearly show the benefit of high-clocked CPUs:

If low latency and especially low write latency is important, then go for the highest clocked CPUs you can get, ideally at least higher than 3 GHz. This may require a compromise in SSD only nodes on how many cores are available and thus how many SSDs each node can support. For nodes with 12 spinning disks and SSD journals, single socket quad core processors make an excellent choice as they are often available with very high clock speeds and are very aggressively priced.
Where latency is not as important, for example, object workloads, look at entry-level processors with well-balanced core counts and clock speeds.
Another consideration around CPU and motherboard choice should be around the number of sockets. In Dual socket designs, the memory, disk controllers, and network interface controllers (NICs) are shared between the sockets. When data required by one CPU is required from a resource located on another CPU's socket, it must cross the interlink bus between the two CPUs. Modern CPUs have high-speed interconnects, but they do introduce some performance penalty and thought should be given to whether a single socket design is achievable. There are some options given in the tuning section on how to work around some of these possible performance penalties.
- PostgreSQL 11 Server Side Programming Quick Start Guide
- Mastercam 2017數(shù)控加工自動編程經(jīng)典實例(第4版)
- 蕩胸生層云:C語言開發(fā)修行實錄
- 控制與決策系統(tǒng)仿真
- 極簡AI入門:一本書讀懂人工智能思維與應(yīng)用
- Visual FoxPro 6.0數(shù)據(jù)庫與程序設(shè)計
- Matplotlib 3.0 Cookbook
- 計算機(jī)網(wǎng)絡(luò)技術(shù)實訓(xùn)
- Learning Azure Cosmos DB
- 網(wǎng)絡(luò)布線與小型局域網(wǎng)搭建
- 激光選區(qū)熔化3D打印技術(shù)
- 走近大數(shù)據(jù)
- 機(jī)器人人工智能
- 大數(shù)據(jù):引爆新的價值點
- 多媒體技術(shù)應(yīng)用教程