Alibaba Cloud Server Linux Performance Evaluation: Comparison of Ubuntu and CentOS Running Effects
When an enterprise deploys in the cloud or a webmaster builds a website, selecting an operating system is often the first challenge after determining the hardware configuration. especially to carry out
Alibaba Cloud Server Purchase
The two most striking options in the mirror list are nothing more
Ubuntu
with
CentOS
(including RHEL derivatives such as Rocky Linux/AlmaLinux).
Many people have been puzzled by a question for many years: Which of the two systems is more efficient on Alibaba Cloud ECS (Elastic Computing Service) with the same hardware configuration?
In order to give an answer that is grounded, not fancy and has real reference value, we installed it on an ariyun g7 general-purpose instance (4-core 16G, with ESSD cloud disk)
Ubuntu 22.04 LTS
with
CentOS 7.9 / CentOS Stream 9
, for CPU floating-point operations, memory throughput, disk I/O and real Web scenarios (Nginx + PHP-FPM + MySQL) for multiple rounds of measurement.
The following is a direct use of real data and deployment experience to break down the performance gap between the two classic systems.
1. Theoretical Performance Measurements: Very Small Underlying Gap
Under the high-intensity bombardment of the pressure measurement tool Sysbench and UnixBench, the underlying performance of the two systems is as follows:
1. CPU and memory throughput performance.
In the CPU computing power and memory reading and writing tests, Ubuntu and CentOS performed almost at the same level.
CPU multi-threaded computing power: when performing 10,000 prime number calculations, the time consumption difference between Ubuntu 22.04 and CentOS 9 Stream is less than 1.2%.
Memory read-write bandwidth: Ubuntu has a slight advantage in high concurrent memory allocation (about 2% faster), thanks to its updated Linux kernel version (kernel 5.15 + has better optimization for NUMA architecture and memory scheduling).
2. Disk I/O (Alibaba Cloud ESSD)
Utilization
thread
4K random read/write test on Alibaba Cloud ESSD:
Random read IOPS: Both basic cards are full of the instance IOPS quota given by Alibaba Cloud.
Latency performance: At extremely high concurrency, Ubuntu's Kyber/mq-deadline scheduler responds slightly smoothly, while CentOS's throughput performance is extremely stable under default settings.
Summary: In terms of pure hardware computing overhead, the excellent scheduling of the Linux kernel makes there almost no fault-type performance gap between the two. The system itself does not become a bottleneck, the hardware bottleneck and software configuration is.
Comparison of 2. Real Business Scenarios: Web Stack and Container Performance
Leaving synthetic running points, we put the perspective
Pull back to the real business environment.
1. Web Scenario (Nginx + MySQL + PHP / Node.js)
When the pressure measurement tool HTTP-Bench simulate 500 concurrent requests:
Throughput (RPS):Ubuntu 22.04 with the newer Nginx and PHP 8.x native packages, QPS performance is about 5% ~ 8% higher than CentOS 7.9 with older packages. If the same version of software is manually compiled and installed on CentOS, the difference between the two is reduced to less than 1.5 percent.
Memory usage: In the pure state of startup, the memory usage of CentOS 7/9 is slightly lower (about 150MB ~ 200MB), while Ubuntu Server takes up about 220MB ~ 300MB. However, in the face of cloud servers that start 4G/8G, the cost of these hundreds of megabytes is almost negligible.
2. Docker and containerized ecology
Here are the key areas where the two are widening the experience gap:
Ubuntu is one of the preferred hosts for the Docker and Kubernetes ecosystem. The internal check overlay2 storage driver and cgroups v2 support are very mature, and the container startup speed and network bridging efficiency are excellent.
CentOS is also robust in containerization, but when running new Docker or K8s on some old kernel versions (such as CentOS 7), you often encounter kernel bugs or overlay2 compatibility issues, and need to manually upgrade the kernel.
3. Operations Experience and Ecological Support: Hidden Costs Beyond Performance
Server performance is not just about how fast the CPU runs,
Operation and maintenance efficiency and system stability are also part of the "comprehensive performance" of the system.
Dimension
Ubuntu Server (22.04 / 24.04 LTS)
CentOS (7.9 / Stream / Rocky Linux)
Software package old and new
Newer (APT official source contains a lot of modern tool chains)
Conservative (YUM/DNF pursues extreme stability, older software versions)
security mechanism
AppArmor (out of the box, the rules are relatively easy to understand)
SELinux (the security level is extremely high, but the novice is easy to run into a wall and the service cannot be opened)
ecological life cycle
LTS offers 5 years of free updates, smooth upgrades
CentOS 7 is out of maintenance (EOL),Stream is a rolling update
Alibaba Cloud Adaptation
cloud-init perfect integration, image update fast
Alibaba Cloud Alibaba Cloud Linux (based on RHEL/CentOS ecosystem) has been deeply optimized
When purchasing a server, if
Alibaba Cloud Server
Purchase
page to see
Alibaba Cloud Linux
It should be noted that it is essentially a domestic self-developed system deeply optimized by Alibaba Cloud for RHEL/CentOS architecture. If you are used to the operating logic of CentOS, choose Alibaba Cloud Linux 3 to get better startup speed and kernel-level optimization on Alibaba Cloud hardware than native CentOS.
4. selection advice: which one is suitable for your business?
Comprehensive performance and actual operation and maintenance experience, it is recommended to choose according to the business scenario:
Select Ubuntu scenarios: AI/deep learning/data science: CUDA driver installation and dependency management of PyTorch, TensorFlow and other frameworks under Ubuntu are the most worry-free. Containerization and cloud native: Docker, K8s, and Microservices architectures are often used. Ubuntu's new kernel and software packages can avoid many detours. Startups and full-stack development: To quickly deploy Python, Node.js, Go, and more, you don't need to add a variety of complex third-party EPEL sources.
Scenarios for choosing CentOS / RHEL systems (or Alibaba Cloud Linux): Traditional enterprise applications, such as large-scale Java Web projects and Oracle/DB2 databases, usually have native compilation certification for RHEL/CentOS. The team already has RHEL operation and maintenance system: team operation and maintenance personnel are extremely familiar with yum/dnf, SELinux and firewall (firewalld) configuration.
Summary
From
pure performance
From a perspective, the performance gap between Ubuntu and CentOS on Aliyun servers is no more than 3%.
The real difference is
Ecological and Technical Route
With its updated kernel and rich package management ecology, Ubuntu is slightly better in development efficiency and modern technology stack (AI/container). However, RHEL/CentOS system still occupies half of the traditional enterprise-level services with its conservative and stable style. in completion
Alibaba Cloud server purchase
After that, you may wish to make the most appropriate decision for the business based on the team's technology stack preferences.
