Compression Function Testing

AI Tools

For compression function testing:

  • Compression is available per volume.

  • Lightbits can support a compression ratio of up to 4:1. Our TCO models target a 2:1 compression ratio.

  • Lightbits uses LZ4 and we compress every 4KB block independently. LZ4 is a well known algorithm, which has a good balance between compression ratio and performance (compression speed/decompression speed).

Test Case

  1. Create two new volumes: one with compression=true and one with compression=false.

  2. Use FIO to perform random write operations on the two new volumes on the client server.

  3. From the Lightbits cluster, check the ratio of capacity and physical use of the newly created volume, and calculate the compression ratio.

  4. Record the performance data of the client server performing IO on two different disks, and compare the performance differences.

To do this, first run a quick cleanup process to delete previously used volumes (to start fresh):

  1. From the client server, disconnect previously used SSD devices. Note that this is not mandatory; it’s only to see a clean and fresh process.

nvme disconnect-all

After the disconnection, no old SSD devices will be attached.

root@rack07-server56:~ nvme disconnect -all root@rack07-server56:~ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 223.6G 0 disk |-sda2 8:2 0 1G 0 part /boot |-sda3 8:3 0 222.6G 0 part | |-inaugurator--v2-osmosis--cache 253:1 0 30G 0 lvm | |-inaugurator--v2-root 253:2 0 147.7G 0 lvm / | -inaugurator--v2-swap 253:0 0 8G 0 lvm [SWAP] sda1 8:1 0 2M 0 part
  1. Delete volumes from the Lightbits cluster, until you have no volumes:

root@rack03-server72:~ lbcli list volumes Name UUID State Protection State NSID Size Replicas Compression ACL Rebuild Progress vol1 01b20f49-13d6-468f-b82d-752594922a6e Available FullyProtected 2 25 GiB 1 false values:"acl3" None clone_snap1 30242a3b-cf7d-4a1e-ae0c-14295b631ebf Available FullyProtected 3 25 GiB 1 false values:"acl3" None vol65 b1c49657-d4a5-4cf8-b8fd-13a0bd0e1358 Available FullyProtected 5 55 GiB 1 false values:"acl3" None vol_comp1 b95efd8f-f93d-40de-b2d3-32d3780376a5 Available FullyProtected 7 30 GiB 1 false values:"acl3" None 1vol c074cf03-83fb-4c15-a601-5444e798f51f Available FullyProtected 4 200 GiB 2 true values:"acl3" None vol_not_comp1 f0c8693d-4be1-4a44-8078-b4fcd777bae4 Deleting FullyProtected 6 30 GiB 1 true values:"acl3" None

Example

lbcli delete volume --name=1vol --project-name=default

Repeat this command until you have no volumes retrieved on the Lightbits cluster.

Create two new volumes: 1 with compression=true and 1 with compression=false.

No compression:

lbcli create volume --size="30 Gib" --name=vol1_not_compressed --acl="acl3" --compression=false --replica-count=1 --project-name=default

With compression:

lbcli create volume --size="50 Gib" --name=vol1_compressed --acl="acl3" --compression=true --replica-count=1 --project-name=default

Check that the volumes are created:

lbcli list volumes

Sample Output

root@rack03-server72:~ lbcli list volumes Name UUID State Protection State NSID Size Replicas Compression ACL RebuildProgress vol1_not_compressed 109a6228-6885-45d2-8ba2-f03541aafa4d Available FullyProtected 9 30 GiB 1 false values:"acl3" None vol1_compressed 853044a6-6ff9-49a0-bffa-0939aee7f4fd Available FullyProtected 11 50 GiB 1 true values:"acl3" None

From the client server, connect to the newly-created volumes and check that the new 30 Gib SSD (compressed) and 50 Gib SSD (not compressed) are attached, with lsblk:

Get and copy cluster NQN:

lbcli get cluster

Sample Output

root@rack11-server93:~ lbcli get cluster UUID Subsystem NQN Current max replicas Supported max replicas MinVersionInCluster MinAllowedVersion MaxAllowedVersion 2ac0b5f1-e332-4526-9799-e5cec2208837 nqn.2016-01.com.lightbitslabs:uuid:1fa41a41-cf47-4ebd-b0f4-babda5fe322c 3 3 2.3.12~b793 2.3.X

Connect to the volume to attach the SSD device to the client (this can be executed with a simple ‘for’ loop as well.)

LIGHTBITS_CONTROLLER_IPS="172.16.231.70 172.16.231.71 172.16.231.72"; for CONTROLLER_IP in $LIGHTBITS_CONTROLLER_IPS; do nvme connect -t tcp -a $CONTROLLER_IP --ctrl-loss-tmo -1 -n $LIGHTBITS_CLUSTER_NQN -s 4420 -q $VOLUME_ACL; done

Check that the volumes are mapped:

lsblk

Sample Output

root@rack07-server56 :~ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme0n1 259:1 0 50G 0 disk nvme0n2 259:3 0 30G 0 disk sda 8:0 0 111.8G 0 disk |-sda2 8:2 0 1G 0 part /boot |-sda3 8:3 0 110.8G 0 part | |-inaugurator--v2-osmosis--cache 253:1 0 30G 0 lvm | |-inaugurator--v2-root 253:2 0 58.2G 0 lvm / | `-inaugurator--v2-swap 253:0 0 8G 0 lvm [SWAP] `-sda1

Use FIO to perform random write operations on the two new volumes on the client server.

Create a file named job-file:

touch job-file.fio

Paste the contents of the following code snippet into the file:

[global] ramp_time=0 rw=randwrite # WRITE #rwmixread=100 # When using randrw in the line above refill_buffers loops=1 buffer_compress_percentage=70 buffer_compress_chunk=4096 direct=1 norandommap=1 time_based log_avg_msec=1000 numjobs=12 # Max value is number of CPU cores iodepth=32 randrepeat=0 ioengine=libaio group_reporting=1 runtime=300 bs=4k [job_compressed] filename=/dev/nvme0n1 # Device path of compressed volume [job_not_compressed] filename=/dev/nvme0n2 # Device path of non-compressed volume

Run FIO Jobs:

fio job-file.fio

Check the size of the volumes on the Lightbits node:

lbcli list volumes -o json

You should see that the volume with compression has less physical space used than the volume without compression.