You need to enable JavaScript to run this app.
导航
常见问题
最近更新时间:2025.04.01 20:13:40首次发布时间:2024.11.12 16:54:08
我的收藏
有用
有用
无用
无用

为什么修改配置后,Presto 服务重启异常

不同于其它服务组件,Presto 对配置项采取严格校验的策略,只要配置项的变更没有通过 Presto 校验(例如配置项的名称或值不能被识别、配置项冗余等),都会导致服务无法正常启动。因此在变更配置前,您需要仔细检查配置项是否正确,一旦出现因为服务参数变更导致的服务启动异常可以先回滚操作,检查正确后再重新配置。

为什么 keystore 证书会发生变更

通常 keystore 证书的变更对用户而言是透明,平台会在每次启动 Presto 服务时校验 keystore 证书的有效性,如果出现如下情况将会重新生成新的 keystore 证书:

  1. keystore 证书过期。
  2. Keystore 证书文件损坏。
  3. keystore 密码发生变更。

如果您是将 keystore 证书文件拷贝到其它节点或本地使用,当 keystore 证书被刷新后需要您主动同步更新后的 keystore 证书文件。

任务执行出现 Query exceeded max memory size 错误

当集群级别内存限制耗尽时会出现此问题,解决方法是调大 query.max-memory 参数值。该参数是集群级别的限制,表示查询可以在所有节点上聚合的最大内存。

任务执行出现 Query exceeded local memory limit 错误

解决方法是将参数 query.max-memory-per-node 值增加到工作节点所在实例内存的 40%,该参数决定查询可以在节点上使用的最大内存。
以下是避免内存问题的建议:

  • 对于 join 操作,当较大的表在右侧时任务可能会出错。因此理想的情况是在 join 的右侧放置较小的表,将较大的表放在左侧。
  • Join 和 Aggregation 构建 HashTable 是比较耗 CPU 和内存的算子,因此建议如果数据量较大时建议开启 spill 策略。

LAS Presto 版本有哪些高级特性

Presto 在 LAS 版本引入了多项优化,包括:Broadcast Join 策略优化和 Reorder Join 优化,能够提升 Join 相关的查询性能;Metastore Client 连接复用,节省查询计划耗时;分区字段 Filter Predicate 消除,加速查询过滤操作等等。本文为您介绍详细优化内容。

Join相关优化

整体说明

Config

Session

Default

Comment

Table rowcount 统计fallback HDFS 和缓存优化

hive.metastore-cbo-cache.enabled

false

cbo cache 开关

hive.metastore-cbo-cache.cache-ttl

60m

cbo cache ttl

hive.metastore-cbo-cache.max-entries

10000

cbo cache max entries

hive.table-statistics-fallback-hdfs-enabled

hive.statistics_fallback_hdfs_enabled

false

hms fallback 开关

hive.hdfs-statistics-timeout

hive.hdfs_statistics_timeout

30

The timeout for getting table statistics(rowcount) from hdfs, unit: seconds

hive.file-statistics-sample-size

hive.file_statistics_sample_size

5

统计 Partition 行数时文件采样大小

Broadcast Join 选择策略优化

use-broadcast-join-first

use_broadcast_join_first

false

在 DetermineJoinDistributionType 基础上与join_distribution_type=AUTOMATIC 结合使用,两表 join 时,只要包含小表就会选择 Broadcast

Join 顺序优化

optimizer.enable-emr-reorder-joins

emr_reorder_joins

false

优化 join 顺序,与join_reordering_strategy=AUTOMATIC 结合使用,能够尽早过滤数据,减少中间结果传输

Metastore Client 连接复用

连接复用,避免了建立连接的开销,优化了Plan Time

config:
hive.metastore.connection-pool-enabled=false
hive.metastore.connection-pool-min-size=1
hive.metastore.connection-pool-refresh-interval=120s
hive.metastore.connection-pool-life-span=1200s

Hadoop configuration 避免反复 copy

修复了 hadoop configuration 在代码中没有复用的问题

分区字段 filter predicate 消除

where 子句中如果分区字段的 filter 条件包含某些函数计算,会导致这些 filter 条件在 table scan 时重复计算。通过将这些分区字段的 filter 进行消除,减少在分区过滤后,还会对分区内的所有分区字段进行row by row 的计算。

session:
set session enable_partition_predicate_eliminate=true;

Location 无感知的 HDFS list status

在与 HDFS 存算分离的场景(Presto 与 HDFS 分开部署在不同节点)开启开关后可以减少 HDFS NameNode 访问提升性能。

config:
hive.location-unaware-directory-listing=false
session:
Set session hive.location_unaware_directory_listing=false;