reservedBytes 预定的内存;Reservations 预定、预约;Revocable 可废止的,可撤回的;allocations 分配
/ui/api/worker/yj-datanode1-0460/status
返回worker 的 heap 和Processors(既cpu 数)
LocalMemoryManager 管理 MemoryPool,MemoryPool=heap - (memory.heap-headroom-per-node,默认=heap*0.3)
trino_memory_MemoryPool_MaxBytes{subcluster="subcluster",instance=\~"datanode"}
trino_memory_MemoryPool_FreeBytes{subcluster="subcluster",instance=\~"datanode"}
trino_memory_MemoryPool_ReservedBytes{subcluster="subcluster",instance=\~"datanode"}
worker 内存
maxBytes=heap - (memory.heap-headroom-per-node,默认=heap*0.3)
FreeBytes = maxBytes - reservedBytes - reservedRevocableBytes
cluster 内存
ClusterMemoryPool
blockedNodes 可以用于监控某个机器有没有空闲资源 FreeBytes() + ReservedRevocableBytes() <=0
totalDistributedBytes=sum_node(MaxBytes)
reservedDistributedBytes=sum_node(ReservedBytes)
reservedRevocableDistributedBytes=sume_node(ReservedRevocableBytes)
clusterMemorymanager
clusterMemoryBytes=sum_node(MaxBytes)
totalAvailableProcessors=sum_node(AvailableProcessors)
clusterUserMemoryReservation=sum_query(UserMemoryReservation)
clusterTotalMemoryReservation=sum_query(TotalMemoryReservation)
trino 查询模型
node 可以运行多个task, task 处理多个split
query-stage-task-split(driver)
task 配置
task.concurrency 并行运算符(例如连接和聚合)的默认本地并发性,默认值:节点的物理CPU数量,最小值为2,最大值为32
task.max-drivers-per-task 控制task同时运行的最大driver数量,默认值: max_int
task.max-worker-threads 设置task处理分片时使用的线程数。如果工作器 CPU 利用率较低且所有线程都在使用中,则增加此数字可以提高吞吐量,但这会导致堆空间使用量增加,默认值: cpu*2
node 配置
node-scheduler.max-splits-per-node 增加此值可以改善查询延迟 默认值:256
node-scheduler.min-pending-splits-per-task 默认值:16
node-scheduler.max-adjusted-pending-splits-per-task 默认值:2000