Skip to main content

I had been running a few Centos 6 servers just past their EOL (30th November 2020) and it was time to kick in to action a plan I had been working on when I realised EOL was on my doorstep.

A month or so beforehand, I started researching options to upgrade to Centos 7.  Okay initially I wanted to jump Centos 7 and charge in to Centos 8 which had a planned EOL of 2029.  CentOS 8 had been stable for well over a year.  Not bad, closer to two years would have been better, but definitely worth looking into an 8 upgrade.  As a reference point, when I started on CentOS 6 it had been stable for just under two years.  However, that all changed when RHEL announced that 8 EOL was being brought forward by eight years to December 2021.  Yet Centos 7 remains supported until 2024.  CentOS Stream is now RHEL's focus.

 

Server configuration
Reference OS CPU RAM HDD
6.0 Centos 6 x86 2 cores 2 GB 50 GB
7.0 CentOS 7 (x86_64) (CT) 2 cores 2 GB 100 GB
7.1 CentOS 7 (x86_64) (CT) 4 cores 8 GB 100 GB
7.2 CentOS 7 (x86_64) (CT) 3 cores 4 GB 100 GB

The CentOS 7 server is running as a Linux Cloud VPS.

Note - 7.2 came in post the testing of 7.1.  This occurred once it was clear that the time issues were not related to resources such as RAM allocation.

 

Speed testing the servers

Initial testing on a freshly installed server Centos 7 showed:

  • Server back ups automated or manual failed immediately.  This was corrected, however, on the next automated run they failed again;
  • Performing what I would say was a simple command cp, I timed the old environment (Centos 6) against Centos 7.  The actual commands performed were:

All times indicated in the tables below are measured in minutes:seconds

command: yes | cp -rf 'stg/core' 'httpdocs'

The directory size is 109MB and number of files 21,059

Runs CentOS 6 (6.0) CentOS 7 (7.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:16 38:12 12:47 1:18
2 0:02 28.32 8:14 0:01
3     5:08  
4     2:43  
5     0:41  
6     0:28  
7     0:21  

command: yes | cp -rf 'stg/vendor' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:03 18:22 8:43 0:30
2 0:01 13:03 8:14 0:01
3     4:42  
4     1:08  
5     0:33  
6     0:14  
7     0:01  

command: yes | cp -rf 'stg/themes' 'httpdocs'

The directory size is 101MB and number of files 5,344

Runs CentOS 6 (6.0) CentOS 7 (7.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:02 16:51 6:11 0:23
2 0:01 10:45 5:46 0:01
3     1:46  
4     0:53  
5     0:24  
6     0:08  
7     0:01  

Note: time measured in mins:secs

From the third run the server configuration was upgraded to the reference 7.1 noted above.

Eventually the times on the CentOS 7 server (reference configuration 7.1) became more reasonable.  However, note that the core directory remained longer to complete than CentOS 6.  Showing 21 against 16 seconds respectively.

As you can see from the test runs above, slowly on the CentOS 7 server the execution times slowly came down.  Most within a second, except for the core that reach its lowest execution time of 21 seconds.  I now wanted to test if this was being influenced by caching or something else.

 

Further testing on a different domain and absolute path version 1

To further check on the speed of the server, I stopped working on the current domain and changed so it had quite a different absolute path.  This was to test the situation where there was a significant update in the code structure.  Therefore, not relying on the cache version of the code on the server.

command: yes | cp -rf 'stg/core' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:16 0:53 7:09
2 0:01 0:01 0:01

command: yes | cp -rf 'stg/vendor' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:03 0:47 0:50
2 0:01 0:01 0:01

command: ​​​​​​​​​​​​​​yes | cp -rf 'stg/themes' 'httpdocs'

The directory size is 101MB and number of files 5,344

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:02 0:25 0:28
2 0:01 0:02 0:01

Note: through out all of these tests I only ever ran two tests on CentOS 6.  This is because once the results reached below one second, there wasn't too much to be improved upon.

 

Changing domains and absolute paths version 2

On the second run, the times had dropped to less than a second.  This was true if I changed to a subdomain.  It seems the cache version was being held at the domain root path.  Once again it was time to change domains and test if the results were reliable.

command: yes | cp -rf 'stg/core' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:16 0:53 4:23
2 0:01 0:01 0:01

command: yes | cp -rf 'stg/vendor' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:03 0:47 1:30
2 0:01 0:01 0:01

command: ​​​​​​​​​​​​​​yes | cp -rf 'stg/themes' 'httpdocs'

The directory size is 101MB and number of files 5,344

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1 0:02 0:25 0:41
2 0:01 0:02 0:01

 

As this stage, I'm seriously considering whether to persist with CentOS 7 and deep dive to establish the reason the execution times are so poor.  However, that could be potentially a big investment of time with little in return.  Essentially I come from a position that a new product should hit the ground running.  That does a superior job than the previous version.

 

Time has passed - any improvements?

Test date / time: 15 February 2021 @ 1 - 2pm

It has been a few weeks since the last check on using the cp command.  Well today I ran the test again and the results were:

command: yes | cp -rf 'stg/core' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1     8:46
2     0:01

command: yes | cp -rf 'stg/vendor' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1     0:50
2     0:01

command: ​​​​​​​​​​​​​​yes | cp -rf 'stg/themes' 'httpdocs'

The directory size is 101MB and number of files 5,344

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1     0:12
2     0:01

 

 

More time has passed - any improvements?

Test date / time: 11 March 2021 @ 3 - 4pm

It has been a almost a month since the last check on using the cp command.  Well I ran the test again and the results were:

command: yes | cp -rf 'stg/core' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1     11:44
2     0:01

command: yes | cp -rf 'stg/vendor' 'httpdocs'

The directory size is 53MB and number of files 5,435

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1     1.40
2     0:01

command: ​​​​​​​​​​​​​​yes | cp -rf 'stg/themes' 'httpdocs'

The directory size is 101MB and number of files 5,344

Runs CentOS 6 (6.0) CentOS 7 (7.1) CentOS 7 (7.2)
1     1:45
2     0:01

 

In comparison to the previous testing, these results are a significant decline.  In fairness, the browser speed has had significant gains.  This makes me question is it just Vanish camouflaging the results.  Clearly more testing is required.  

Related articles

Andrew Fletcher18 Mar 2024
Resolving CVE-2022-48624 less issue
To resolve the CVE-2022-48624 vulnerability on Ubuntu using Nginx, it's crucial to understand that the issue lies within the "less" package, not Nginx itself. The vulnerability affects "less" before version 606, where close_altfile in filename.c in less omits shell_quote calls for LESSCLOSE,...
Andrew Fletcher12 Mar 2024
How to determine the size of a directory in Terminal
To determine the size of a directory using the terminal, you can use the du (disk usage) command. The syntax for this command can vary slightly depending on the operating system you are using, but a common way to use it is as follows: For Linux and macOSdu -sh /path/to/directoryduDisk...