Rate This Document
Findability
Accuracy
Completeness
Readability

Verifying the Effect of Object Storage Compression

  1. Install s3cmd.
    1
    2
    yum -y install s3cmd
    vi ~/.s3cfg
    
    [default]
    access_key = access_key
    secret_key = secret_key
    host_base = rgw_host_ip:rgw_host_port
    host_bucket = compress_ratio_bucket
    use_https = False
    Table 1 Parameter description

    Parameter

    Description

    access_key

    Set this parameter to the actual access key of the S3 user.

    secret_key

    Set this parameter to the actual secret key of the S3 user.

    host_base

    Set this parameter to the actual IP address and port number of the RGW gateway.

  2. Create a bucket.
    s3cmd mb s3://compress_ratio_bucket
  3. Keep a 100 MB test file ready for the test.
    dd if=/dev/zero of=/home/compress_test bs=1M count=100

    You can also use a real dataset file.

  4. Write the data.
    1
    s3cmd put /home/compress_test s3://compress_ratio_bucket/test
    
  5. Verify the compression effect.
    1
    radosgw-admin bucket stats --bucket=compress_ratio_bucket
    

    size_kb_actual indicates that the size of the raw data is 100 MB. size_kb_utilized indicates that the size of the data is 4 KB after compression. Therefore, the compression ratio is 102400/4 = 25,600. In the example, all-zero data is used, so the compression ratio is high. The actual compression ratio of a dataset is between 2 to 10.