Compression Function Testing
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
- Create two new volumes: one with compression=true and one with compression=false.
- Use FIO to perform random write operations on the two new volumes on the client server.
- From the Lightbits cluster, check the ratio of capacity and physical use of the newly created volume, and calculate the compression ratio.
- 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):
- From the client server, disconnect previously used NVMe devices. Note that this is not mandatory; it’s only to see a clean and fresh process.
nvme disconnect-allAfter the NVMe disconnection, no old NVMe devices will be attached.
root@rack07-server56:~ nvme disconnect -allroot@rack07-server56:~ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 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- Delete volumes from the Lightbits cluster, until you have no volumes:
root@rack03-server72:~ lbcli list volumesName UUID State Protection StateNSID Size Replicas Compression ACL Rebuild Progressvol1 01b20f49-13d6-468f-b82d-752594922a6e Available FullyProtected 2 25 GiB 1 false values:"acl3" Noneclone_snap1 30242a3b-cf7d-4a1e-ae0c-14295b631ebf Available FullyProtected 3 25 GiB 1 false values:"acl3" Nonevol65 b1c49657-d4a5-4cf8-b8fd-13a0bd0e1358 Available FullyProtected 5 55 GiB 1 false values:"acl3" Nonevol_comp1 b95efd8f-f93d-40de-b2d3-32d3780376a5 Available FullyProtected 7 30 GiB 1 false values:"acl3" None1vol c074cf03-83fb-4c15-a601-5444e798f51f Available FullyProtected 4 200 GiB 2 true values:"acl3" Nonevol_not_comp1 f0c8693d-4be1-4a44-8078-b4fcd777bae4 Deleting FullyProtected 6 30 GiB 1 true values:"acl3" NoneExample
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=defaultWith compression:
lbcli create volume --size="50 Gib" --name=vol1_compressed --acl="acl3" --compression=true --replica-count=1 --project-name=defaultCheck that the volumes are created:
lbcli list volumesSample Output
root@rack03-server72:~ lbcli list volumesName UUID State ProtectionState NSID Size Replicas Compression ACL RebuildProgressvol1_not_compressed 109a6228-6885-45d2-8ba2-f03541aafa4d Available FullyProtected 9 30 GiB 1 false values:"acl3" Nonevol1_compressed 853044a6-6ff9-49a0-bffa-0939aee7f4fd Available FullyProtected 11 50 GiB 1 true values:"acl3" NoneFrom the client server, connect to the newly-created volumes and check that the new 30 Gib NVMe (compressed) and 50 Gib NVMe (not compressed) are attached, with lsblk:
Get and copy cluster NQN:
lbcli get clusterSample Output
root@rack11-server93:~ lbcli get clusterUUID Subsystem NQN Current max replicas Supported max replicas MinVersionInCluster MinAllowedVersion MaxAllowedVersion2ac0b5f1-e332-4526-9799-e5cec2208837 nqn.2016-01.com.lightbitslabs:uuid:1fa41a41-cf47-4ebd-b0f4-babda5fe322c 3 3 2.3.12~b793 2.3.XConnect to the volume to attach the NVMe 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; doneCheck that the volumes are mapped:
lsblkSample Output
root@rack07-server56 :~ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTnvme0n1 259:1 0 50G 0 disknvme0n2 259:3 0 30G 0 disksda 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]`-sda1Use FIO to perform random write operations on the two new volumes on the client server.
Create a file named job-file:
touch job-file.fioPaste the contents of the following code snippet into the file:
[global]ramp_time=0rw=randwrite # WRITE#rwmixread=100 # When using randrw in the line aboverefill_buffersloops=1buffer_compress_percentage=70buffer_compress_chunk=4096direct=1norandommap=1time_basedlog_avg_msec=1000numjobs=12 # Max value is number of CPU coresiodepth=32randrepeat=0ioengine=libaiogroup_reporting=1runtime=300bs=4k[job_compressed]filename=/dev/nvme0n1 # Device path of compressed volume[job_not_compressed]filename=/dev/nvme0n2 # Device path of non-compressed volumeRun FIO Jobs:
fio job-file.fioCheck the size of the volumes on the Lightbits node:
lbcli list volumes -o jsonYou should see that the volume with compression has less physical space used than the volume without compression.