Give benefits! Get free access to Alibaba Cloud's popular products (including ECS), click to enter : https://click.aliyun.com/m/1000370359/
This blog participates in the evaluation of Alibaba Cloud ECS instance, here uses Ali's C5.large computing instance
This experience and suggestions on cloud server ECS product capabilities can help other users choose cloud services and use cloud server ECS to create application scenario evaluation
Firstly, test the hardware (CPU, memory, disk) of the instance, and compare it with AWS C5 and C5a instances of the same size, as you can see in "Catalogue 2 and 3" of this article.
Secondly, "use cloud server ECS to create application scenario evaluation, build cloud blogs, forums, home clouds, and Gitlab collaborative office based on Alibaba Cloud ECS c5. large adopts LAMP and LNMP architecture to build Wordpress scene, and LAMP builds Discuz! Forum scenario, installation of CasaOS home cloud private NAS scenario, installation of Jihu GitLab integrated DevOps platform scenario. I hope this article is helpful to you, and also allows you to purchase the server you need among many service providers.
This reading is expected to take 45 minutes.
corresponding video
Alibaba Cloud Community : https://developer.aliyun.com/live/249082
BiliBili platform : https://www.bilibili.com/video/BV1iL4y1F7nm
Article directory:
- 1. Instance console comparison
- 1. Alibaba Cloud
- A. Custom purchase
- B. Quick buy
- 2.AWS
- 1. Alibaba Cloud
- 2. Comparison of instance types
- 1. Introduction to Alibaba Cloud C5 instance family
- 2. Introduction to AWS EC2 C5.large and C5a.large
- 3. Model comparison summary
- 3. Compared with the same type of performance test
- 1. CPU test (GeekBench 5 tests the instance)
- A. The CPU model of the test object collected in this test
- B. Test command
- c. Test results
- D. CPU summary test comparison
- 2. Block storage performance test
- 1.hdparm test hard disk performance
- 2. Use the dd command to test the performance of the disk
- 3. Fio tool test hard disk
- 3. Memory performance test
- View memory information
- Memory writing and reading test (Alibaba Cloud on the left-AWS on the right)
- 1. CPU test (GeekBench 5 tests the instance)
- 4. Service construction comparison test
- 1. Build WordPress personal blog based on LAMP architecture (CentOS 7)
- 2. Building WordPress personal blog based on LNMP architecture (CentOS 7)
- 3. Build LAMP architecture based on Aliux 3 system and deploy Wordpress personal blog
- 4. Build LNMP architecture based on Aliux 3 system and deploy Wordpress personal blog
- 5. Deploy Discuz forum based on LAMP architecture (CentOS 7)
- 6. Build CasaOS family cloud based on ubuntu
- 7. Based on Ubuntu 20.04 64, install the privatized deployment version Jihu GitLab
- Summarize
1. Instance console comparison
2. Comparison of instance types
3. Compared with the same type of performance test
4. Service construction comparison test
1. Instance console comparison
1. Alibaba Cloud:
A. Custom purchase:
First, open Alibaba Cloud's ECS instance console, and you can clearly see the created instance in the overview panel
After clicking Create Instance, a new browser page will pop up, which defines two panel modules, Quick Purchase and Custom Purchase, which clearly show the user's payment mode, purchase region, availability zone, and instance specifications. , quantity, storage, etc., follow the process to confirm the order, a total of five steps
B. Quick Buy:
Compared with custom purchase, users can directly place an order on the quick purchase interface without jumping to other pages for additional settings
2.AWS:
Go to the EC2 console
After clicking Start Instance, you will enter the Create Instance page, where you need to configure the instance,
including: instance name, image, instance specification, security group, key, network, storage size, etc.
2. Comparison of instance types
#### Alibaba Cloud official recommendations for different application scenarios![](https://img-blog.csdnimg.cn/img_convert/e405cc7045aef17c5840ae39c2bef0d1.png)1. Introduction to Alibaba Cloud C5 instance family, citing official documents
Computing instance type family c5
c5 has the following features:
-
calculate:
-
The ratio of processor to memory is 1:2
-
Processor: Intel ® Xeon ® Platinum 8163 (Skylake) or 8269CY (Cascade Lake) with a main frequency of 2.5 GHz, stable computing performance
Note that instances of this specification family may be deployed on different server platforms. If your business requires instances to be deployed on the same server platform, it is recommended that you choose c6, c6e, or c7.
-
-
storage:
- I/O optimization example
- Support ESSD cloud disk, SSD cloud disk and high-efficiency cloud disk
Note that the cloud disk performance upper limit of different instance type families is different, and a single instance of this type family supports up to 200,000 IOPS
-
network:
- Support IPv6
- Ultra-high network PPS sending and receiving packet capability
- The network performance of the instance corresponds to the computing specification (the higher the specification, the stronger the network performance)
-
Applicable scene:
- High network packet sending and receiving scenarios, such as video barrage, telecom service forwarding, etc.
- Web front-end server
- Massively Multiplayer Online Game (MMO) Frontend
- Data Analysis, Batch Computing, Video Encoding
The instance specifications and index data included in the high-performance scientific and engineering application c5 are shown in the following table
instance specification | vCPU | Memory | Network bandwidth (Gbit/s) | Network sending and receiving packet PPS | multiple queues | ENI | Single network card private IP |
---|---|---|---|---|---|---|---|
ecs.c5.large | 2 | 4 | 1 | 300000 | 2 | 2 | 6 |
2. AWS EC2 C5.large and C5a.large instances, refer to AWS official documents to explain
Amazon EC2 C5 instances are optimized for compute-intensive workloads and deliver cost-effective high performance at a lower price per compute ratio.
Features:
- C5 instances offer processor options based on the size of the instance.
- The new C5 and C5d 12xlarge, 24xlarge and Metal instance sizes feature custom 2nd Gen Intel Xeon Scalable processors (Cascade Lake) with a sustained all-core turbo frequency of 3.6GHz and single-core turbo frequencies up to 3.9GHz.
- Additional C5 instance sizes will launch on 2nd Gen Intel Xeon Scalable processors (Cascade Lake) or 1st Gen Intel Xeon Platinum 8000 series (Skylake-SP) processors with sustained all-core Turbo frequencies up to 3.4GHz, and Up to 3.5GHz single-core Turbo frequency.
- New larger 24xlarge instance size offers 96 vCPUs, 192 GiB memory and optional 3.6TB NVMe-based local SSD
- Requires HVM AMI with ENA and NVMe drivers
- The Elastic Network Adapter (ENA) provides C5 instances with up to 25Gbps of network bandwidth and up to 19Gbps of Amazon EBS dedicated bandwidth.
- Powered by the AWS Nitro system (a combination of purpose-built hardware and a lightweight hypervisor)
model | vCPU | Memory | Instance storage (GB) | Network Bandwidth (Gbps) | EBS Bandwidth (Mbps) |
---|---|---|---|---|---|
ecs.c5.large | 2 | 4 | EBS only | up to 10 | Up to 4750 |
Amazon EC2 C5a instances offer best-in-class x86 price/performance for a wide range of compute-intensive workloads.
Features:
- 2nd generation AMD EPYC 7002 series processors running up to 3.3GHz
- Elastic Network Adapter (ENA) provides C5a instances with up to 20 Gbps of network bandwidth and up to 9.5 Gbps of Amazon EBS dedicated bandwidth
- Powered by the AWS Nitro system (a combination of purpose-built hardware and a lightweight hypervisor)
model | vCPU | Memory | Instance storage (GB) | Network Bandwidth (Gbps) | EBS Bandwidth (Mbps) |
---|---|---|---|---|---|
c5a.large | 2 | 4 | EBS only | up to 10 | up to 3170 |
3. Model comparison summary:
Aliyun ecs.c5.large high-efficiency cloud disk version | AWS C5.large EBS SSD gp2 | AWS C5a.large EBS SSD gp2 | |
---|---|---|---|
CPU model | 2.5 GHz Intel ® Xeon ® Platinum 8163 (Skylake) or 8269CY (Cascade Lake) | 2nd Generation Intel Xeon Scalable Processor (Cascade Lake) or 1st Generation Intel Xeon Platinum 8000 Series (Skylake-SP) Processor | 2nd Generation AMD EPYC 7002 |
vCPU | 2 | 2 | 2 |
Memory | 4G | 4G | 4G |
Network bandwidth (Gbit/s) | 1Gbps | Up to 10Gbps | Up to 10Gbps |
Block Storage Bandwidth | High-efficiency cloud disk up to 140Mbps | Up to 4750Mbps | Up to 3170Mbps |
3. Compared with the same type of performance test
## 1. CPU test **GeekBench 5 tests the instance**Here, Alibaba Cloud Aliyun ecs.c5.large high-efficiency cloud disk version is used to compare AWS EC2 C5.large and C5a.large. In order to ensure that C5 uses Intel chips, 2 sets of C5.large and 1 set of C5a.large are used here. carry out testing
A. The CPU models of the test objects collected in this test are as follows
example | CPU model |
---|---|
Aliyun ecs.c5.large | Intel Xeon Platinum 8163 @ 2.50 GHz 1 Processor, 1 Core, 2 Threads |
Amazon EC2 c5.large | Intel Xeon Platinum 8275CL @ 3.64 GHz 1 Processor, 1 Core, 2 Threads |
Amazon EC2 c5.large | Intel Xeon Platinum 8124M @ 3.45 GHz 1 Processor, 1 Core, 2 Threads |
Amazon EC2 c5a.large | AMD EPYC 7R32 @ 3.31 GHz 1 Processor, 1 Core, 2 Threads |
B. The test command is as follows:
sudo wget https://cdn.geekbench.com/Geekbench-5.4.1-Linux.tar.gz
tar xf Geekbench-5.4.1-Linux.tar.gz
cd Geekbench-5.4.1-Linux
./geekbench5
C. The test results are as follows
①.Aliyun ecs.c5.large
Intel Xeon Platinum 8163 @ 2.50 GHz 1 Processor, 1 Core, 2 Threads
-
Geekbench5 detection system information
-
single core test project
-
Multi-core test project
-
Link to Test Results
-
Test result graph
②.Amazon EC2 c5.large
Intel Xeon Platinum 8275CL @ 3.64 GHz 1 Processor, 1 Core, 2 Threads
-
Geekbench5 detection system information
-
single core test project
-
Multi-core test project
-
Link to Test Results
-
Test result graph
③.Amazon EC2 c5.large
Intel Xeon Platinum 8124M @ 3.45 GHz 1 Processor, 1 Core, 2 Threads
-
Geekbench5 detection system information
-
single core test project
-
Multi-core test project
-
Link to Test Results
-
Test result graph
④.Amazon EC2 c5a.large
AMD EPYC 7R32 @ 3.31 GHz 1 Processor, 1 Core, 2 Threads
-
Geekbench5 detection system information
-
single core test project
-
Multi-core test project
-
Link to Test Results
-
Test result graph
D. CPU summary test comparison
Comparison test link:
8163 VS 8275CL
https://browser.geekbench.com/v5/cpu/compare/14590617?baseline=14590554
8163 VS 8124M
https://browser.geekbench.com/v5/cpu/compare/14590617?baseline=14591215
Intel Xeon Platinum 8163 @ 2.50 GHz VS AMD EPYC 7R32 @ 3.31 GHz
https://browser.geekbench.com/v5/cpu/compare/14590617?baseline=14594576
Aliyun ecs.c5.large
Intel Xeon Platinum 8163 @ 2.50 GHz 1 Processor, 1 Core, 2 Threads 对比 AWS EC2 C5.Large Intel Xeon Platinum 8275CL @ 3.64 GHz 1 Processor, 1 Core, 2 Threads
Aliyun ecs.c5.large
Intel Xeon Platinum 8163 @ 2.50 GHz 1 Processor, 1 Core, 2 Threads 对比 Amazon EC2 c5.large Intel Xeon Platinum 8124M @ 3.45 GHz 1 Processor, 1 Core, 2 Threads
Aliyun ecs.c5.large
Intel Xeon Platinum 8163 @ 2.50 GHz 1 Processor, 1 Core, 2 Threads 对比 Amazon EC2 c5a.large AMD EPYC 7R32 @ 3.31 GHz 1 Processor, 1 Core, 2 Threads
2. Block storage performance test
1.hdparm test hard disk performance
显示硬盘的相关信息
# hdparm /dev/vda
评估硬盘的读取效率
# hdparm -t /dev/vda
测试硬盘缓存的读取速度
# hdparm -T /dev/vda
直接测试硬盘的读性能
# hdparm -tT --direct /dev/vda
查看DMA情况
# hdparm -cdt /dev/vda
2. Use the dd command to test the performance of the disk
dd test script
[root@sh-host ~]# cat disk.sh
echo "test 10G"
time sh -c "dd if=/dev/zero of=./ddfile bs=1M count=10240 oflag=direct && sync";
rm ./ddfile;
echo "test 1G/1M"
time sh -c "dd if=/dev/zero of=./ddfile bs=1M count=1024 oflag=direct && sync";
rm ./ddfile;
echo "test 1G/512K"
time sh -c "dd if=/dev/zero of=./ddfile bs=512k count=2048 oflag=direct && sync";
rm ./ddfile;
echo "test 1G/256K"
time sh -c "dd if=/dev/zero of=./ddfile bs=256k count=4096 oflag=direct && sync";
rm ./ddfile;
echo "test 1G/256K"
time sh -c "dd if=/dev/zero of=./ddfile bs=256k count=8192 oflag=direct && sync";
rm ./ddfile;
echo "test 1G/4K"
time sh -c "dd if=/dev/zero of=./ddfile bs=4k count=262144 oflag=direct && sync";
rm ./ddfile;
dd test results are as follows
AWS EBS SSD gp2 20G
[root@ip-172-31-30-56 ~]# bash disk.sh
test 10G
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB) copied, 78.9134 s, 136 MB/s
real 1m18.923s
user 0m0.005s
sys 0m1.313s
test 1G/1M
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 7.98374 s, 134 MB/s
real 0m7.990s
user 0m0.007s
sys 0m0.131s
test 1G/512K
2048+0 records in
2048+0 records out
1073741824 bytes (1.1 GB) copied, 7.98495 s, 134 MB/s
real 0m7.991s
user 0m0.006s
sys 0m0.149s
test 1G/256K
4096+0 records in
4096+0 records out
1073741824 bytes (1.1 GB) copied, 7.98434 s, 134 MB/s
real 0m7.987s
user 0m0.002s
sys 0m0.159s
test 1G/256K
8192+0 records in
8192+0 records out
2147483648 bytes (2.1 GB) copied, 15.9784 s, 134 MB/s
real 0m15.981s
user 0m0.011s
sys 0m0.303s
test 1G/4K
262144+0 records in
262144+0 records out
1073741824 bytes (1.1 GB) copied, 127.651 s, 8.4 MB/s
real 2m7.655s
user 0m0.286s
sys 0m2.382s
[root@ip-172-31-30-56 ~]#
Aliyun EBS high-efficiency cloud disk 20G
[root@sh-host ~]# bash disk.sh
test 10G
10240+0 records in
10240+0 records out
10737418240 bytes (11 GB) copied, 99.4206 s, 108 MB/s
real 1m39.440s
user 0m0.028s
sys 0m1.916s
test 1G/1M
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB) copied, 9.9211 s, 108 MB/s
real 0m9.942s
user 0m0.003s
sys 0m0.206s
test 1G/512K
2048+0 records in
2048+0 records out
1073741824 bytes (1.1 GB) copied, 9.93499 s, 108 MB/s
real 0m9.955s
user 0m0.003s
sys 0m0.221s
test 1G/256K
4096+0 records in
4096+0 records out
1073741824 bytes (1.1 GB) copied, 9.90859 s, 108 MB/s
real 0m9.927s
user 0m0.006s
sys 0m0.256s
test 1G/256K
8192+0 records in
8192+0 records out
2147483648 bytes (2.1 GB) copied, 19.87 s, 108 MB/s
real 0m19.889s
user 0m0.014s
sys 0m0.496s
test 1G/4K
262144+0 records in
262144+0 records out
1073741824 bytes (1.1 GB) copied, 132.547 s, 8.1 MB/s
real 2m12.565s
user 0m0.284s
sys 0m6.281s
[root@sh-host ~]#
3. Fio tool test hard disk
The official document test specifies the test tool - FIO
Check out the documents provided by the two cloud service providers here, and both clearly use the fio tool for the benchmark test of the cloud disk
Steps
1. Remotely connect to the ECS instance
and use SecureCRT to connect
2. Query whether the block storage device is 4KiB aligned
sudo fdisk -lu
In the returned result, if the Start value is divisible by 8, it is 4KiB aligned. Otherwise, please complete the 4KiB alignment before continuing the performance test.
3. Run the following commands in sequence to install libaio and FIO.
sudo yum install libaio -y
sudo yum install libaio-devel -y
sudo yum install fio -y
4. Partition and format the hard disk.
Disk partition example, take Amazon as an example
-
Use fdisk to view mounted disks
-
fdisk partitions a disk
-
fdisl -l View partition results
-
Format the disk with mkfs
-
Use lsblk to view
Cloud disk performance test command
Note In this example, the name of the device used is /dev/your_device , please replace it according to your actual situation. For example, the cloud disk to be tested is /dev/vdb , then replace /dev/your_device in the following example command with /dev/vdb
Random write IOPS:
fio -direct=1 -iodepth=128 -rw=randwrite -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/your_device -name=Rand_Write_Testing
Alibaba Cloud Efficient Cloud Disk
Amazon AWS SSD GP2
Random read IOPS:
fio -direct=1 -iodepth=128 -rw=randread -ioengine=libaio -bs=4k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/your_device -name=Rand_Read_Testing
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
Sequential write throughput:
fio -direct=1 -iodepth=64 -rw=write -ioengine=libaio -bs=1024k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/your_device -name=Write_PPS_Testing
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
Sequential read throughput:
fio -direct=1 -iodepth=64 -rw=read -ioengine=libaio -bs=1024k -size=1G -numjobs=1 -runtime=1000 -group_reporting -filename=/dev/your_device -name=Read_PPS_Testing
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
Random write latency:
fio -direct=1 -iodepth=1 -rw=randwrite -ioengine=libaio -bs=4k -size=1G -numjobs=1 -group_reporting -filename=/dev/your_device -name=Rand_Write_Latency_Testing
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
Random read latency:
fio -direct=1 -iodepth=1 -rw=randread -ioengine=libaio -bs=4k -size=1G -numjobs=1 -group_reporting -filename=/dev/your_device -name=Rand_Read_Latency_Testing
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
The following command performs a 16 KB random write operation.
sudo fio --filename=/dev/your_device --ioengine=psync --name fio_test_file --direct=1 --rw=randwrite --bs=16k --size=1G --numjobs=16 --time_based --runtime=180 --group_reporting --norandommap
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
The following command performs a 16 KB random read operation.
sudo fio --filename=/dev/your_device --name fio_test_file --direct=1 --rw=randread --bs=16k --size=1G --numjobs=16 --time_based --runtime=180 --group_reporting --norandommap
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
The following command performs a sequential read of 1 MiB:
sudo fio --filename=/dev/<device> --direct=1 --rw=read --randrepeat=0 --ioengine=libaio --bs=1024k --iodepth=8 --time_based=1 --runtime=180 --name=fio_direct_read_test
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
The following command performs a sequential write operation of 1 MiB to a block device:
sudo fio --filename=/dev/<device> --direct=1 --rw=write --randrepeat=0 --ioengine=libaio --bs=1024k --iodepth=8 --time_based=1 --runtime=180 --name=fio_direct_write_test
Alibaba Cloud High Efficiency Cloud Disk
Amazon AWS SSD GP2
3. Memory performance test
View memory information
Memory writing and reading test (Alibaba Cloud on the left-AWS on the right)
# time sh -c "dd if=/dev/zero of=/dev/shm/fill bs=1M count=10240" #写入测试
# time sh -c "dd if=/dev/shm/fill of=/dev/null bs=1M count=10240" #读取测试
4. Service construction comparison test
1. Building WordPress personal blog based on LAMP architecture (CentOS 7)
1. Install mariadb, php, http and other services
yum -y install mariadb mariadb-server php php-server wget php-fpm php-mysql
2. Start httpd, mariadb, and initialize mairadb
systemctl start mariadb httpd
3. Initialize the database
mysql_secure_installation #设置数据库root用户密码
4. Test PHP
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
Open a browser to access the local ip, and ensure that the ECS instance security group opens port 80
http://Host_IP/phpinfo.php
Delete the phpinfo.php test file
rm -f /var/www/html/phpinfo.php
5. Download wordpress 4.9 Chinese version and configure it
wget https://cn.wordpress.org/wordpress-4.9-zh_CN.tar.gz
If you feel that the online download is slow, you can download it to the computer first and then upload it to the server, using winSCP
6. Unzip the tar package
tar -zxf wordpress-4.9-zh_CN.tar.gz
7. Log in to mysql, create a wordpress database and user, and use a password for demonstration is very simple, just for demonstration, please do not follow blindly
MariaDB [(none)]> create database `wordpress-db`;
MariaDB [(none)]> grant all privileges on `wordpress-db`.* to 'wordpress'@'localhost' identified by '000000';
MariaDB [(none)]> flush privileges;
8. Copy wp-config-sample.php as wp-config.php, and edit the configuration
[root@sh-host ~]# cp wordpress/wp-config-sample.php wordpress/wp-config.php
[root@sh-host ~]# vi wordpress/wp-config.php
Modify the database name database user and password in the configuration
As shown in the figure, modify the following lines
23, 26, and 29
to set the previously created database name, login database account, and password. Here, you can also create a wordpress exclusive database user. This is only for demonstration, please do not follow blindly.
9. Copy the contents of the wordpress installation directory to the http directory
[root@sh-host ~]# cp -r wordpress/* /var/www/html/
10. Allow WordPress to use permalink
[root@sh-host ~]# vi /etc/httpd/conf/httpd.conf
Modify AllowOverride None on line 151 to AllowOverride All
11. Restart httpd and mariadb services
[root@sh-host ~]# systemctl restart httpd mariadb
12. Visit the background of the web page for final configuration
Entering the IP address in the browser will automatically jump to the background setting page
At this point, the Wordpress blog is built, and you can DIY your own Worpress blog according to your preferences
13. View the load of the C5 instance
Install the cloud monitoring plug-in
Alibaba Cloud instance cloud monitoring address : https://cloudmonitornext.console.aliyun.com/hostMonitoring/all
This picture is the console monitoring picture of ECS C5.large. It can be seen that WordPress running the LAMP architecture is simply drizzle on C5. The CPU is basically in a silent state, and the average memory is about 20%.
2. Building WordPress personal blog based on LNMP architecture (CentOS 7)
1. Install nginx, mariadb, php
yum -y install nginx mariadb mariadb-server php php-server wget php-fpm php-mysql
2. Start mariadb and initialize mairadb
systemctl start mariadb
mysql_secure_installation #设置数据库root用户密码
Open a browser to access the local ip, and ensure that the ECS instance security group opens port 80
3. Modify php-fpm and nginx configuration files
edit configuration file
vi /etc/nginx/nginx.conf
Modify the content of lines 44 and 45, remove the comments of 65-71, and modify
location / {
root /usr/share/nginx/html/;
index index.php index.html index.htm; //在这里加上 index.php
}
location ~ \.php$ {
root /usr/share/nginx/html/; //修改为网站目录
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; //修改 /scripts 为 $document_root
include fastcgi_params;
}
4. Edit the php-fpm configuration file
[root@sh-host ~]# vi /etc/php-fpm.d/www.conf
Modify the content of lines 39 and 14 to change the original apache to nginx
5. Start PHP
[root@sh-host ~]# systemctl start php-fpm
6. Download wordpress 4.9 Chinese version and configure it
wget https://cn.wordpress.org/wordpress-4.9-zh_CN.tar.gz
If you feel that the online download is slow, you can download it to the computer first and then upload it to the server, using winSCP
Unzip the tarball
tar -zxf wordpress-4.9-zh_CN.tar.gz
7. Log in to mysql, create a wordpress database and user, and use a password for demonstration is very simple, just for demonstration, please do not follow blindly
MariaDB [(none)]> create database `wordpress-db`;
MariaDB [(none)]> grant all privileges on `wordpress-db`.* to 'wordpress'@'localhost' identified by '000000';
MariaDB [(none)]> flush privileges;
8. Copy wp-config-sample.php as wp-config.php, and edit the configuration
[root@sh-host ~]# cp wordpress/wp-config-sample.php wordpress/wp-config.php
[root@sh-host ~]# vi wordpress/wp-config.php
Modify the database name database user and password in the configuration.
As shown in the figure, modify the following lines
23, 26
, and 29 to set the previously created database name, login database account, and password respectively. This is only for demonstration, please do not follow blindly
9. Copy the contents of the WordPress installation directory to the /usr/share/nginx/ directory
Remove the page file of the original directory
[root@sh-host ~]# mv /usr/share/nginx/html/* /opt/
[root@sh-host ~]# cp -r wordpress/* /usr/share/nginx/html/
10. Change nginx directory permissions
[root@sh-host ~]# chown -R nginx:nginx /usr/share/nginx/
11. Restart nginx and mariadb services
[root@sh-host ~]# systemctl restart nginx mariadb
#或者nginx -s reload
12. Visit the background of the web page for final configuration
Entering the IP address in the browser will automatically jump to the background setting page
13. View instance load
At this point, the Wordpress blog is built, and you can DIY your own Worpress blog according to your preferences
Install the cloud monitoring plug-in
Alibaba Cloud instance cloud monitoring address : https://cloudmonitornext.console.aliyun.com/hostMonitoring/all
View the load of the C5 instance
This picture is the console monitoring picture of ECS C5.large. It can be seen from this that the WordPress CPU running the LNMP architecture is basically in a silent state. Compared with LAMP, the memory usage rate is slightly higher.
3. Build LAMP architecture based on Aliux 3 system and deploy Wordpress personal blog
1. Replace the system first
2. Connect to the instance for basic settings
①. First connect the instance
②.Update yum source
yum -y update
③. Check the firewall
systemctl status firewalld #查看防火墙状态
systemctl stop firewalld #临时关闭防火墙
systemctl disable firewalld #关闭开机自启防火墙
3. Install the LAMP environment
①. Install the latest version of the Apache web server, and the PHP package for Amazon Linux 2022
sudo yum install -y httpd wget php-fpm php-mysqli php-json php php-devel
②. Install the MariaDB package
yum -y install mariadb mariadb-server
③. Start the Apache Web server and set it to start automatically
systemctl start httpd
systemctl enable httpd
systemctl is-enabled httpd #查看是否启动
④.mariadb, and initialize mairadb
systemctl start mariadb
systemctl enable mariadb
④. Initialize the database
mysql_secure_installation #设置数据库root用户密码
⑤. Log in to mysql, create a wordpress database and user, and use a password for demonstration is very simple, just for demonstration, please do not follow blindly
MariaDB [(none)]> create database `wordpress-db`;
MariaDB [(none)]> grant all privileges on `wordpress-db`.* to 'wordpress'@'localhost' identified by '000000';
MariaDB [(none)]> flush privileges;
⑥. Test php
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
Open a browser to access the local ip, and ensure that the ECS instance security group opens port 80
http://Host_IP/phpinfo.php
⑦. Delete the phpinfo.php file
rm -f /var/www/html/phpinfo.php
4. Install Wordpress and visit
①.Download wordpress 4.9 Chinese version
wget https://cn.wordpress.org/wordpress-4.9-zh_CN.tar.gz
②. Unzip the tar package
tar -zxf wordpress-4.9-zh_CN.tar.gz
③. Copy wp-config-sample.php as wp-config.php, and edit the configuration
cp wordpress/wp-config-sample.php wordpress/wp-config.php
vi wordpress/wp-config.php
Modify the database name database user and password in the configuration
As shown in the figure, modify the following lines
23, 26, and 29
to set the previously created database name, login database account, and password. Here, you can also create a wordpress exclusive database user. This is only for demonstration, please do not follow blindly.
④. Copy the contents of the wordpress installation directory to the http directory
[root@sh-host ~]# cp -r wordpress/* /var/www/html/
⑤. Allow WordPress to use permalink
[root@sh-host ~]# vi /etc/httpd/conf/httpd.conf
Modify AllowOverride None near line 151 to AllowOverride All
⑥. Restart httpd and mariadb services
[root@sh-host ~]# systemctl restart httpd mariadb
⑦. Visit the background of the web page for final configuration
Entering the IP address in the browser will automatically jump to the background setting page
So far, your wordpress personal blog has been built, you can upgrade the latest version of wordpress yourself, and you can also publish articles and accept advertisements
5. View instance monitoring
Install the cloud monitoring plug-in
Alibaba Cloud instance cloud monitoring address : https://cloudmonitornext.console.aliyun.com/hostMonitoring/all
According to the practice of this evaluation, we still check the monitoring of the instance. From the figure below, we can see that wordpress based on the LAMP architecture running on Alinux 3 still occupies very low instance resources, and even consumes less memory than CentOS.
4. Build LNMP architecture based on Aliux 3 system and deploy Wordpress personal blog
Since the official document provides Alinux2 to build the LNMP architecture method, it will not be demonstrated here, only Alinux 3 will be demonstrated here
1. Replace the system first
2. Connect to the instance for basic settings
①. First connect the instance
②.Update yum source
yum -y update
③. Check the firewall
systemctl status firewalld #查看防火墙状态
systemctl stop firewalld #临时关闭防火墙
systemctl disable firewalld #关闭开机自启防火墙
2. Install the LNMP environment
①.Install nginx
Note This tutorial only provides one version of Nginx as an example. If you need to install other versions of Nginx, please refer to FAQ.
Run the following command to install Nginx .
yum -y install nginx
Run the following command to check the Nginx version .
nginx -v
The returned results are as follows, indicating that Nginx is installed successfully.
nginx version: nginx/1.20.1
②. Install mariadb
yum -y install mariadb mariadb-server
Start mariadb and view version information
systemctl start mariadb
systemctl enable mariadb
mysql -V
③. Initialize the database
mysql_secure_installation #设置数据库root用户密码
④. Log in to mysql, create a wordpress database and user, it is very simple to use a password for demonstration, just for demonstration, please do not follow blindly
MariaDB [(none)]> create database `wordpress-db`;
MariaDB [(none)]> grant all privileges on `wordpress-db`.* to 'wordpress'@'localhost' identified by '000000';
MariaDB [(none)]> flush privileges;
⑤. Install php
yum -y install php php-fpm php-mysqlnd
⑥. Test php
echo "<?php phpinfo(); ?>" > /usr/share/nginx/html/phpinfo.php
Open a browser to access the local ip, and ensure that the ECS instance security group opens port 80
http://Host_IP/phpinfo.php
⑦. Delete the phpinfo.php file
rm -f /usr/share/nginx/html/phpinfo.php
4. Install Wordpress and visit
①.Download wordpress 4.9 Chinese version
wget https://cn.wordpress.org/wordpress-4.9-zh_CN.tar.gz
②. Unzip the tar package
tar -zxf wordpress-4.9-zh_CN.tar.gz
③. Copy wp-config-sample.php as wp-config.php, and edit the configuration
cp wordpress/wp-config-sample.php wordpress/wp-config.php
vi wordpress/wp-config.php
Modify the database name database user and password in the configuration
As shown in the figure, modify the following lines
23, 26, and 29
to set the previously created database name, login database account, and password. Here, you can also create a wordpress exclusive database user. This is only for demonstration, please do not follow blindly.
④. Copy the contents of the wordpress installation directory to the nginx directory
[root@sh-host ~]# cp -r wordpress/* /usr/share/nginx/html/
⑤. Change nginx directory permissions
chown -R nginx:nginx /usr/share/nginx/
⑥. Access the instance address for configuration
5. View instance monitoring
Install the cloud monitoring plug-in
Alibaba Cloud instance cloud monitoring address : https://cloudmonitornext.console.aliyun.com/hostMonitoring/all
According to the usual practice, still check the load of the instance
From the monitoring data, Alibaba Linux 3 seems to use a little less memory on average to host wordpress in an LNMP environment than the LAMP architecture. Still, after the overall deployment, there is no burden on the C5.large instance, and wordpress runs with a very low resource load. system, indicating that c5.large is fully capable of this task, and also reflects the powerful performance of Alibaba Cloud ECS C5 computing instances
5. Deploy the Discuz forum based on the LAMP architecture
1. Install necessary services and components (using offline sources/online sources are also available)
Install Apache, mariadb-server, php, php-mysql //php-mysql is a component for php to connect to mysql
Install apache and mariadb-server:
yum -y install httpd mariadb-server php php-mysql
2. Enable http, mariadb service and set boot automatically
systemctl start httpd mariadb
systemctl enable httpd mariadb
3. Initialize the database
mysql_secure_installation #设置数据库root用户密码
4. Log in to the database and create the corresponding database, set the discuz database login user
mysql -uroot -p //根据自己设定的mysqlroot密码进行登陆
5. Create discuz database:
MariaDB [(none)]> create database discuz;
#给discuz创建一个用户,并且赋予权限:
MariaDB [(none)]> grant all on discuz.* to 'ad-discuz'@'localhost' identified by '000000'; //这里设置ad-discuz用户登录管理 discus 数据库 ,此步骤也可省略,之间使用root用户数据库进行连接
6. Build Discuz! Community Forum
①. Use the wget command to download the zip package and decompress it
Install wget and unzip commands
yum -y install wget unzip
wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip #获取zip源码包
unzip Discuz_X3.2_SC_UTF8.zip #使用unzip命令解压zip包
②.Copy files
Copy the files in upload to the /var/www/html directory, and use the chmod command to recursively grant 777 permissions to all files in the html directory
cp -r upload/* /var/www/html/
chmod -R 777 /var/www/html/* //请注意,不要打错命令,否则在安装时会提示不可写
③. Restart the httpd service and use the browser to deploy
[root@sh-host ~]# systemctl restart httpd
Browser input: deployment server IP address,
④.Installation step 1:
⑤.Installation step 2, choose new installation
⑥.Installation step 3, create a database, select the previously created database
⑦. Wait for the installation to complete
⑧. Login test
7. View instance monitoring data
At this point, the Discuz forum installation is complete
As usual, check the monitoring data of the server
6. Build CasaOS family cloud based on ubuntu
CasaOS official website : https://www.casaos.io/
CasaOS Github project address : https://github.com/IceWhaleTech/CasaOS
1. System Selection
Refer to the installation system recommended by Github, here we use Ubuntu server 20.04 amd 64
2. Install with one-click script
curl -fsSL https://get.icewhale.io/casaos.sh | bash
If it prompts that Downloading CasaOS failed, please re-run the script until it succeeds
3. Then visit your public IP address
4. Set your account password
5. You can see your CasaOS cloud on the interface
Click the application center to install services in the container mode, including common NextCloud, Jellyfin, Emby, Qbittorrent , etc.
6. Application installation demo
①. Here I click to install a NextCloud for demonstration. After the installation is complete, it is as follows
②.Click the icon of NextCloud, pay attention to the connection port of the pop-up website window
Open instance security group ports
Note that the port is open
③. Set up nextcloud, including the administrator’s account password, data storage location, and database settings. You can choose three databases. After setting, slide to the bottom and click Install.
④. At this point, your nextCloud container installation is complete
6. View server performance monitoring with CasaOS installed and running a NextCloud container
7. Based on Ubuntu 20.04 64, install the privatized deployment version Jihu GitLab
1. Install and configure the necessary dependencies
sudo apt-get update
sudo apt-get install -y curl openssh-server ca-certificates tzdata perl
2. Download Jihu GitLab installation package and install Jihu GitLab
①. Download Jihu GitLab installation package.
# Ubuntu 16.04
wget https://omnibus.gitlab.cn/ubuntu/xenial/gitlab-jh_14.10.0-jh.0_amd64.deb
# Ubuntu 18.04
wget https://omnibus.gitlab.cn/ubuntu/bionic/gitlab-jh_14.10.0-jh.0_amd64.deb
# Ubuntu 20.04
wget https://omnibus.gitlab.cn/ubuntu/focal/gitlab-jh_14.10.0-jh.0_amd64.deb
②. Next, install Jihu GitLab.
Make sure you have set up your DNS correctly, and change https://gitlab.example.com to the URL you want to access Jifox GitLab instance. The installation package will automatically configure and start Jifox GitLab on this URL.
For https sites, GitLab will automatically request an SSL certificate using Let's Encrypt, which requires a valid hostname and inbound HTTP access. You can also use your own certificate or just http:// (without the s).
Check out the documentation if you want to specify a custom password for the initial admin user (root) . If no password is specified, a random password will be automatically generated.
Document address : https://docs.gitlab.cn/omnibus/installation/index.html#%E8%AE%BE%E7%BD%AE%E5%88%9D%E5%A7%8B%E5%AF% 86%E7%A0%81
Execute the following command to start the installation:
#请将https://gitlab.example.com 替换为您自己的域名,如果没有证书就使用 http://gitlab.example.com 采用http://
sudo EXTERNAL_URL="https://gitlab.example.com" dpkg -i gitlab-jh_14.10.0-jh.0_amd64.deb
③. Wait for the installation to complete
3. Access Jihu GitLab instance and log in
View system generated password
cat /etc/gitlab/initial_root_password
It is recommended to change the initial password immediately after the installation is successful and the initial login is successful). Log in with this password and username root.
4. Subsequent configuration
Please refer to GitLab official website
https://docs.gitlab.cn/jh/install/next_steps.html
Summarize
first
I am very honored to be able to participate in this May Day event. Because I have used AWS for a long time, I specially added AWS EC2 in this article for comparative testing. It can also be regarded as a performance reference group. In comparison, Alibaba Cloud ECS C5.large is indeed inferior in CPU performance, but in terms of cost performance, Alibaba Cloud ECS is indeed the first choice. Even better, Alibaba Cloud can "reinstall the system" , which is indeed the advantage of Alibaba Cloud. For ordinary users, they prefer to directly replace the system instead of re-opening an instance. Obviously, it is easier and more convenient to replace the system. I hope that the catalog 1 and catalog 2 of this article will give users some intuitive data. New users can directly receive the Alibaba Cloud ECS shared instance n4 to build the service environment of this article, to feel the charm of Alibaba Cloud ECS cloud server
Let’s talk about the service construction link:
①System: Here, CentOS 7, Alinux 3, and Ubuntu 20.04 are used to build. In the LAMP and LNMP links, CentOS 7 and Alinux 3 are equivalent to comparative reference. From the monitoring data, it can be seen that Alinux 3 seems to have the same memory usage in terms of memory usage. save a little more
②Network: The entire service environment is built and tested smoothly, and the network performance is not limited. Check the official documents, and the maximum downlink speed is 1Gbps. In the experiment, the speed of downloading files is basically maintained between 100Mbps-200Mbps. Finally, there was a pull of the nextcloud container environment. I thought it would take a lot of time or even fail. Surprisingly, it was pulled very quickly. Here we can see that the network environment of the Alibaba Cloud ECS cloud server is excellent. .
③CPU: The service construction environment demonstrated in this article uses Alibaba Cloud ECS C5.large (2H4G) cloud server. After the construction of each service environment is completed, there will be an instance monitoring diagram. Personal blog, forum, or home cloud, GitLab integrated DevOps platform, the overall CPU load is very low, as a computing instance, the performance is still very satisfactory
④Memory and disk: In the process of building the entire service environment and subsequent access, you can feel that the entire system is very smooth, which also proves that the high-efficiency cloud disk in Alibaba Cloud block storage can fully meet the performance requirements of ordinary users.
Overall, the performance of Alibaba Cloud ECS C5.large instances is very strong. According to Alibaba Cloud's official statement, the recommended application scenario for C series instances is the "Web server" scenario. This can be seen from the LAMP and LNMP commonly used by users. C5 series instances are indeed fully capable of this task, and the overall resource load of the instance is very small, which is completely suitable for users to host web services. When testing in LAMP and LNMP scenarios, it can also be seen from the monitoring data that Alinux 3 is overall better. Users are also recommended to use Alinux here.
Finally, arrange benefits for everyone:
send benefits! Get free access to Alibaba Cloud's popular products (including ECS), click to enter : https://click.aliyun.com/m/1000370359/