压缩率太低了,有没有办法提高下

【TDengine 使用环境】
生产环境 /测试/ Poc/预生产环境

【TDengine 版本】3.3.8

【操作系统以及版本】centos7.9

【部署方式】容器/非容器部署 docker

【集群节点数】

【集群副本数】

【描述业务影响】

【问题复现路径/shan】做过哪些操作出现的问题

【遇到的问题:问题现象及影响】

【资源配置】

【报错完整截图】

cat > /root/insert.json << 'EOF'
{
  "filetype": "insert",
  "cfgdir": "/etc/taos",
  "host": "127.0.0.1",
  "port": 6030,
  "user": "root",
  "password": "taosdata",
  "thread_count": 10,
  "create_table_thread_count": 10,
  "confirm_parameter_prompt": "no",
  "num_of_records_per_req": 10000,
  "prepared_rand": 10000,
  "chinese": "no",
  "escape_character": "yes",
  "continue_if_fail": "no",
  "databases": [
    {
      "dbinfo": {
        "name": "vehicle_db",
        "drop": "yes",
        "vgroups": 4,
        "precision": "ms"
      },
      "super_tables": [
        {
          "name": "vehicle_data",
          "child_table_exists": "no",
          "childtable_count": 1000000,
          "childtable_prefix": "v",
          "auto_create_table": "yes",
          "batch_create_tbl_num": 100,
          "data_source": "rand",
          "insert_mode": "taosc",
          "non_stop_mode": "no",
          "line_protocol": "line",
          "insert_rows": 1000,
          "childtable_limit": 0,
          "childtable_offset": 0,
          "interlace_rows": 0,
          "insert_interval": 0,
          "partial_col_num": 0,
          "timestamp_step": 1000,
          "start_timestamp": "2025-01-01 00:00:00.000",
          "sample_format": "csv",
          "sample_file": "./sample.csv",
          "use_sample_ts": "no",
          "tags_file": "",
          "columns": [
            {
              "type": "TIMESTAMP",
              "count": 1
            },
            {
              "type": "FLOAT",
              "name": "speed",
              "count": 1,
              "min": 0,
              "max": 120
            },
            {
              "type": "INT",
              "name": "direction",
              "count": 1,
              "min": 0,
              "max": 359
            },
            {
              "type": "FLOAT",
              "name": "altitude",
              "count": 1,
              "min": 0,
              "max": 5000
            },
            {
              "type": "DECIMAL",
              "name": "fuel",
              "count": 1,
              "min": 0,
              "max": 100
            },
            {
              "type": "TINYINT",
              "name": "status",
              "count": 1,
              "min": 0,
              "max": 2
            }
          ],
          "tags": [
            {
              "type": "int",
              "name": "vehicle_id",
              "len": 20,
              "count": 1,
              "min": 0,
              "max": 9999
            },
            {
              "type": "BINARY",
              "name": "vehicle_type",
              "len": 10,
              "values": [
                "car",
                "truck",
                "bus"
              ]
            },
            {
              "type": "BINARY",
              "name": "region",
              "len": 10,
              "values": [
                "north",
                "south",
                "east",
                "west"
              ]
            }
          ]
        }
      ]
    }
  ]
}
EOF

对于压缩来说,由于无损压缩总会存在有些数据无法压缩,压缩的数据模型都存在假设;所以随机生成的数据参考价值不高,请采样部分实际生产数据,然后再做评估。

这个压缩率 是和字段类型有关系吗 ?我的压缩率怎么才50

压缩率与字段类型、前后值之间的变化率、写入模式等都有相关。

插入模式,可选项有 taosc、rest、stmt、sml、sml-rest,分别对应普通写入、restful 接口写入、参数绑定接口写入、schemaless 接口写入、restful schemaless 接口写入 (由 taosAdapter 提供)。默认值为 taosc

我现在用的默认的 这个模式 对压缩率影响有啥不同吗

有具体的文档吗 我想看下

1、 数据压缩 | TDengine 文档 | 涛思数据 这里是压缩的技术描述;
2、磁盘占用空间,除了压缩率外,还有可能块中的记录不饱满。TDengine 文件保存是以 block 为粒度,一个block中只保存某一张表的数据,当落盘时,一张表的数据超过了 minrows,就会占用一个block。这样就可能会有空闲的。
这种情况需要后续通过compact 命令来进行重整。提升磁盘占用。但这个功能需要企业版才支持。

是不是我操作有问题 TDengine的子表中不支持存储这么多条数据 ?

子表的数据量超过1000了 才导致压缩率这么低的 同时查询的时候 qps 也变小了

在企业版可以通过 compact 功能来提升磁盘占用率 和 查询性能。