跳到主要内容
跳到主要内容

system.server_settings

在 ClickHouse Cloud 中查询

此系统表中的数据在 ClickHouse Cloud 中的每个节点上本地保存。因此,要获得所有数据的完整视图,需要使用 clusterAllReplicas 函数。有关进一步的详细信息,请参见 这里

包含关于服务器全局设置的信息,这些设置在 config.xml 中指定。目前,此表仅显示 config.xml 中第一层的设置,并不支持嵌套配置(例如 logger)。

列:

  • name (String) — 服务器设置名称。
  • value (String) — 服务器设置值。
  • default (String) — 服务器设置默认值。
  • changed (UInt8) — 显示设置是否在 config.xml 中指定。
  • description (String) — 短的服务器设置描述。
  • type (String) — 服务器设置值类型。
  • changeable_without_restart (Enum8) — 设置在服务器运行时是否可以更改。值:
    • 'No'
    • 'IncreaseOnly'
    • 'DecreaseOnly'
    • 'Yes'
  • is_obsolete (UInt8) - 显示设置是否已过时。

示例

以下示例显示如何获取名称包含 thread_pool 的服务器设置的信息。

SELECT *
FROM system.server_settings
WHERE name LIKE '%thread_pool%'
┌─name──────────────────────────────────────────┬─value─┬─default─┬─changed─┬─description─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬─type───┬─changeable_without_restart─┬─is_obsolete─┐
│ max_thread_pool_size                          │ 10000 │ 10000   │       0 │ The maximum number of threads that could be allocated from the OS and used for query execution and background operations.                           │ UInt64 │                         No │           0 │
│ max_thread_pool_free_size                     │ 1000  │ 1000    │       0 │ The maximum number of threads that will always stay in a global thread pool once allocated and remain idle in case of insufficient number of tasks. │ UInt64 │                         No │           0 │
│ thread_pool_queue_size                        │ 10000 │ 10000   │       0 │ The maximum number of tasks that will be placed in a queue and wait for execution.                                                                  │ UInt64 │                         No │           0 │
│ max_io_thread_pool_size                       │ 100   │ 100     │       0 │ The maximum number of threads that would be used for IO operations                                                                                  │ UInt64 │                         No │           0 │
│ max_io_thread_pool_free_size                  │ 0     │ 0       │       0 │ Max free size for IO thread pool.                                                                                                                   │ UInt64 │                         No │           0 │
│ io_thread_pool_queue_size                     │ 10000 │ 10000   │       0 │ Queue size for IO thread pool.                                                                                                                      │ UInt64 │                         No │           0 │
│ max_active_parts_loading_thread_pool_size     │ 64    │ 64      │       0 │ The number of threads to load active set of data parts (Active ones) at startup.                                                                    │ UInt64 │                         No │           0 │
│ max_outdated_parts_loading_thread_pool_size   │ 32    │ 32      │       0 │ The number of threads to load inactive set of data parts (Outdated ones) at startup.                                                                │ UInt64 │                         No │           0 │
│ max_unexpected_parts_loading_thread_pool_size │ 32    │ 32      │       0 │ The number of threads to load inactive set of data parts (Unexpected ones) at startup.                                                              │ UInt64 │                         No │           0 │
│ max_parts_cleaning_thread_pool_size           │ 128   │ 128     │       0 │ The number of threads for concurrent removal of inactive data parts.                                                                                │ UInt64 │                         No │           0 │
│ max_backups_io_thread_pool_size               │ 1000  │ 1000    │       0 │ The maximum number of threads that would be used for IO operations for BACKUP queries                                                               │ UInt64 │                         No │           0 │
│ max_backups_io_thread_pool_free_size          │ 0     │ 0       │       0 │ Max free size for backups IO thread pool.                                                                                                           │ UInt64 │                         No │           0 │
│ backups_io_thread_pool_queue_size             │ 0     │ 0       │       0 │ Queue size for backups IO thread pool.                                                                                                              │ UInt64 │                         No │           0 │
└───────────────────────────────────────────────┴───────┴─────────┴─────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────┴────────────────────────────┴─────────────┘

使用 WHERE changed 可以很有用,例如,当你想检查配置文件中的设置是否正确加载并正在使用时。

SELECT * FROM system.server_settings WHERE changed AND name='max_thread_pool_size'

另请参见