Fix Geekbench test failed and low memory was detected.

I ran yet-another-bench-script (yabs) script with my new VPS and encountered an error.

Example yabs result:

root@us:~# curl -sL yabs.sh | bash
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
Yet-Another-Bench-Script
v2023-02-27
https://github.com/masonr/yet-another-bench-script
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##

Fri Mar 10 04:30:37 UTC 2023
Basic System Information:

Uptime : 0 days, 15 hours, 30 minutes
Processor : AMD EPYC 7551P 32-Core Processor
CPU cores : 1 @ 1999.999 MHz
AES-NI : ✔ Enabled
VM-x/AMD-V : ❌ Disabled
RAM : 969.5 MiB
Swap : 0.0 KiB
Disk : 902.3 GiB
Distro : Ubuntu 22.04.1 LTS
Kernel : 5.15.0-46-generic
VM Type : KVM
Basic Network Information:

Protocol : IPv6
ISP : HostHatch
ASN : AS63473 HostHatch, LLC
Host : HostHatch LLC
Location : Los Angeles, California (CA)
Country : United States
fio Disk Speed Tests (Mixed R/W 50/50):
Block Size 	4k (IOPS) 	64k (IOPS)
Read 	6.88 MB/s (1.7k) 	68.66 MB/s (1.0k)
Write 	6.90 MB/s (1.7k) 	69.07 MB/s (1.0k)
Total 	13.79 MB/s (3.4k) 	137.74 MB/s (2.1k)
		
Block Size 	512k (IOPS) 	1m (IOPS)
------ 	--- ---- 	---- ----
Read 	192.32 MB/s (375) 	181.73 MB/s (177)
Write 	202.54 MB/s (395) 	193.83 MB/s (189)
Total 	394.86 MB/s (770) 	375.56 MB/s (366)
iperf3 Network Speed Tests (IPv4):
Provider 	Location (Link) 	Send Speed 	Recv Speed 	Ping
Clouvider 	London, UK (10G) 	1.26 Gbits/sec 	1.40 Gbits/sec 	
Scaleway 	Paris, FR (10G) 	1.19 Gbits/sec 	busy 	145 ms
NovoServe 	North Holland, NL (40G) 	1.31 Gbits/sec 	busy 	148 ms
Uztelecom 	Tashkent, UZ (10G) 	845 Mbits/sec 	675 Mbits/sec 	240 ms
Clouvider 	NYC, NY, US (10G) 	1.94 Gbits/sec 	busy 	59.5 ms
Clouvider 	Dallas, TX, US (10G) 	3.19 Gbits/sec 	4.62 Gbits/sec 	29.2 ms
Clouvider 	Los Angeles, CA, US (10G) 	3.66 Gbits/sec 	4.84 Gbits/sec 	0.791 ms
iperf3 Network Speed Tests (IPv6):
Provider 	Location (Link) 	Send Speed 	Recv Speed 	Ping
^PClouvider 	London, UK (10G) 	busy 	busy 	
Scaleway 	Paris, FR (10G) 	1.43 Gbits/sec 	1.16 Gbits/sec 	152 ms
NovoServe 	North Holland, NL (40G) 	1.17 Gbits/sec 	1.20 Gbits/sec 	151 ms
Uztelecom 	Tashkent, UZ (10G) 	782 Mbits/sec 	669 Mbits/sec 	238 ms
Clouvider 	NYC, NY, US (10G) 	2.38 Gbits/sec 	2.90 Gbits/sec 	59.0 ms
Clouvider 	Dallas, TX, US (10G) 	3.97 Gbits/sec 	3.79 Gbits/sec 	29.0 ms
Clouvider 	Los Angeles, CA, US (10G) 	6.62 Gbits/sec 	4.78 Gbits/sec 	0.531 ms

Geekbench test failed and low memory was detected. Add at least 1GB of SWAP or use GB4 instead (higher compatibility with low memory systems).

YABS completed in 11 min 29 sec
root@usbackup:~# curl -sL yabs.sh | bash

How to fix

As we can see on my benchmark result, my ubuntu template didn't come with a swap (0.0 KiB). So to fix this error, add at least 1 GB of swap. Add swap with this method:

First, create a file that will be used as a swap:

sudo fallocate -l 2G /swapfile

Set the file permissions to 600 to prevent regular users to write and read the file:

sudo chmod 600 /swapfile

Create a Linux swap area on the file:

sudo mkswap /swapfile
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=fde7d2c8-06ea-400a-9027-fd731d8ab4c8

Activate the swap file by running the following command:

sudo swapon /swapfile

Verify that the swap is active by using either the swapon or the freecommand, as shown below:

sudo swapon --show
Output
root@us:~# sudo swapon --show
NAME      TYPE SIZE USED PRIO
/swapfile file   2G  44M   -2

As we can see, I added a 2GB Swap while my ram is 1GB.

However, if we reboot, the server will not retain the swap settings automatically. To make it permanent, add the swap file to our /etc/fstab file.

Back up the /etc/fstab file in case anything goes wrong:

sudo cp /etc/fstab /etc/fstab.bak

Add the swap file information to the end of your /etc/fstab file by typing:

/swapfile swap swap defaults 0 0
/etc/fstab

Re-run yabs script

Ran yabs script to benchmark again with:

curl -sL yabs.sh | bash
root@usbackup:~# curl -sL yabs.sh | bash
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
#              Yet-Another-Bench-Script              #
#                     v2023-02-27                    #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #

Sat Mar 11 12:52:04 UTC 2023

Basic System Information:
---------------------------------
Uptime     : 1 days, 5 hours, 24 minutes
Processor  : AMD EPYC 7551P 32-Core Processor
CPU cores  : 1 @ 1999.999 MHz
AES-NI     : ✔ Enabled
VM-x/AMD-V : ❌ Disabled
RAM        : 981.2 MiB
Swap       : 2.0 GiB
Disk       : 902.3 GiB
Distro     : Ubuntu 20.04.3 LTS
Kernel     : 5.4.0-91-generic
VM Type    : KVM

Basic Network Information:
---------------------------------
Protocol   : IPv6
ISP        : HostHatch
ASN        : AS63473 HostHatch, LLC
Host       : HostHatch LLC
Location   : Los Angeles, California (CA)
Country    : United States

fio Disk Speed Tests (Mixed R/W 50/50):
---------------------------------
Block Size | 4k            (IOPS) | 64k           (IOPS)
  ------   | ---            ----  | ----           ----
Read       | 6.35 MB/s     (1.5k) | 55.53 MB/s     (867)
Write      | 6.35 MB/s     (1.5k) | 56.09 MB/s     (876)
Total      | 12.71 MB/s    (3.1k) | 111.62 MB/s   (1.7k)
           |                      |
Block Size | 512k          (IOPS) | 1m            (IOPS)
  ------   | ---            ----  | ----           ----
Read       | 173.30 MB/s    (338) | 230.71 MB/s    (225)
Write      | 182.50 MB/s    (356) | 246.07 MB/s    (240)
Total      | 355.81 MB/s    (694) | 476.78 MB/s    (465)

iperf3 Network Speed Tests (IPv4):
---------------------------------
Provider        | Location (Link)           | Send Speed      | Recv Speed      | Ping
-----           | -----                     | ----            | ----            | ----
Clouvider       | London, UK (10G)          | 1.00 Gbits/sec  | 1.41 Gbits/sec  |
Scaleway        | Paris, FR (10G)           | 1.52 Gbits/sec  | busy            | 144 ms
NovoServe       | North Holland, NL (40G)   | 1.33 Gbits/sec  | 1.10 Gbits/sec  | 148 ms
Uztelecom       | Tashkent, UZ (10G)        | 638 Mbits/sec   | 468 Mbits/sec   | 243 ms
Clouvider       | NYC, NY, US (10G)         | busy            | busy            | 58.2 ms
Clouvider       | Dallas, TX, US (10G)      | 3.25 Gbits/sec  | 4.79 Gbits/sec  | 29.2 ms
Clouvider       | Los Angeles, CA, US (10G) | 3.54 Gbits/sec  | busy            | 0.994 ms

iperf3 Network Speed Tests (IPv6):
---------------------------------
Provider        | Location (Link)           | Send Speed      | Recv Speed      | Ping
-----           | -----                     | ----            | ----            | ----
Clouvider       | London, UK (10G)          | busy            | busy            |
Scaleway        | Paris, FR (10G)           | busy            | busy            | 152 ms
NovoServe       | North Holland, NL (40G)   | 1.17 Gbits/sec  | 1.12 Gbits/sec  | 148 ms
Uztelecom       | Tashkent, UZ (10G)        | busy            | 589 Mbits/sec   | 243 ms
Clouvider       | NYC, NY, US (10G)         | busy            | busy            | 58.1 ms
Clouvider       | Dallas, TX, US (10G)      | 3.42 Gbits/sec  | 3.52 Gbits/sec  | 28.8 ms
Clouvider       | Los Angeles, CA, US (10G) | 7.18 Gbits/sec  | 6.23 Gbits/sec  | 0.686 ms

Geekbench 6 Benchmark Test:
---------------------------------
Test            | Value
                |
Single Core     | 486
Multi Core      | 276
Full Test       | https://browser.geekbench.com/v6/cpu/495970
HostHatch Storage VPS Benchmark

Thanks for reading!