Skip to Content
Trino 权威指南:原书第2版
book

Trino 权威指南:原书第2版

by Matt Fuller, Manfred Moser, Martin Traverso
July 2023
Intermediate to advanced
278 pages
5h 40m
Chinese
China Machine Press
Content preview from Trino 权威指南:原书第2版
生产环境中的
Trino
|
243
12.3
内存管理
想要正确地配置和管理
Trino
集群的内存并不容易。许多持续变化的因素会影响内存
需求:
工作节点的数量
协调器和工作节点的内存
数据源的数量和类型
所执行的查询的特性
用户的数量
对于
Trino
这样的多用户、多工作节点系统,资源管理是一个极具挑战性的任务。基本
上来说,你要先选择一个起始点,再通过不断地监控并调整系统,使其满足现在和未来
的需求。让我们深入细节,讨论一些关于在
Trino
中管理和监控内存的建议和指导方针。
这里讨论的所有内存管理方法都应用于运行
Trino
工作节点的
JVM
。这些内
存都是在工作节点的
JVM
中分配的,因此
JVM
本身的配置也需要考虑到这
些值,以容纳所设定的内存分配量。
根据并行运行的查询数量,
JVM
可用的内存可能需要设定为一个更大的值,
下面的例子说明了这一点。
之前提到的所有影响因素都可以合并为工作负载这一因素进行考量。集群内存的调优重
度依赖上面运行的工作负载。
例如,大多数查询包含多个
Join
、聚合和窗函数。如果查询的工作负载轻,就可以为单
个查询设置较低的内存限制并提高并发性;反过来,如果查询的工作负载重,就只能提
高单个查询的内存限制并降低并发性。近似来讲,查询的规模相当于查询本身的特性和
输入数据量的乘积。
Trino
提供了一系列通过
config.properties
文件设定的属性值,可以
让你在部署时管理集群的内存使用:
query.max-memory-per-node
query.max-memory ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9787111731603