RT 4.0.3 到 4.4.3 由于 ACL 检查导致性能问题

RT 4.0.3 to 4.4.3 leads to performance issues due ACL checks

我正在尝试将旧的请求跟踪器 4.0.3 实例更新到 4.4.3。升级甚至适用于 82'319 用户(包括特权 LDAP 用户;ExternalAuth)。

到目前为止一切顺利,但我意识到使用特权用户显示队列的性能非常慢。显示的队列越长,执行时间越长。我说的是几分钟......通过使用 root 用户或具有管理权限的特权用户“做任何事情或什么都不做”(从德语翻译)我立即得到了队列。

此外,我发现 mysql 查询会导致执行时间过长。由于根执行不需要 ACL 检查,因此运行速度更快。但我想消耗这么多时间是不正常的。花了几个小时才弄明白。

基本上查询的差异(MYSQL EXPLAIN SELECT ...)是:

| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | SIMPLE| Groups_2| ref| groups1,groups2,groups3| groups1 | 67 | const | 693212 | Using where; Distinct | SIMPLE | CachedGroupMembers_3 | ref | DisGrouMem,CachedGroupMembers3,cachedgroupmembers1 | DisGrouMem | 12 | rt3.Groups_2.id,const,const | 1 | Using where; Using index; Distinct

我猜 Groups table 中的 693212 行差不多了。具有相同未更新实例的旧(仍然 运行)RT 4.0.3 实例运行起来非常棒。

我是不是搞错了?

顺便说一句,我在数据库升级期间收到了这个警告:

Processing 4.3.0 Now inserting data. [6564] [Wed Aug 29 22:44:51 2018] [warning]: You have 11141 users(s) with a non-empty value for column 'ExternalAuthId'. Core RT does not use this column, so perhaps an extension or local modification makes use of it. Please migrate these user values to a custom field or an attribute because this upgrade will drop these columns. at ./etc/upgrade/4.3.0/content line 67. (./etc/upgrade/4.3.0/content:67) [6564] [Wed Aug 29 22:44:51 2018] [warning]: You have 256 users(s) with a non-empty value for column 'AuthSystem'. Core RT does not use this column, so perhaps an extension or local modification makes use of it. Please migrate these user values to a custom field or an attribute because this upgrade will drop these columns. at ./etc/upgrade/4.3.0/content line 67. (./etc/upgrade/4.3.0/content:67)

我没有做任何更改来解决这个问题,但由于 LDAP 用户仍然可以登录,我想这不是问题所在。

有人有什么想法吗?

用户: SELECT DISTINCT main.* FROM Tickets main LEFT JOIN Groups Groups_2 ON ( Groups_2.Domain = 'RT::Ticket-Role' ) AND ( Groups_2.Instance = main.id ) JOIN Queues Queues_1 ON ( Queues_1.id = main.Queue ) LEFT JOIN CachedGroupMembers CachedGroupMembers_3 ON ( CachedGroupMembers_3.Disabled = '0' ) AND ( CachedGroupMembers_3.MemberId = '1296794' ) AND ( CachedGroupMembers_3.GroupId = Groups_2.id ) WHERE ( ( main.Queue IN ('44', '59', '1', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '19', '20', '21', '22', '23', '24', '25', '26', '27', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '57', '58', '59', '60', '62', '63', '64', '65', '66', '68', '69', '72', '78', '79', '73', '80', '82', '83', '85', '88', '90', '92', '93', '94', '97', '99', '28', '102', '103', '106', '108', '109') OR ( CachedGroupMembers_3.MemberId IS NOT NULL AND Groups_2.Name = 'Requestor' ) OR ( CachedGroupMembers_3.MemberId IS NOT NULL AND Groups_2.Name = 'Cc' AND main.Queue IN ('77') ) OR ( CachedGroupMembers_3.MemberId IS NOT NULL AND Groups_2.Name = 'AdminCc' ) OR ( main.Owner = '1296794' ) ) ) AND (main.IsMerged IS NULL) AND (main.Status != 'deleted') AND (main.Type = 'ticket') AND (main.Queue = '72' AND ( ( Queues_1.Lifecycle = 'assets' AND ( main.Status = 'new' OR main.Status = 'allocated' OR main.Status = 'in-use' ) ) OR ( Queues_1.Lifecycle = 'default' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) OR ( Queues_1.Lifecycle = 'approvals' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) ) ) ORDER BY main.id ASC LIMIT 50;

一组 11 行(37.49 秒)

根目录:

SELECT main.* FROM Tickets main JOIN Queues Queues_1 ON ( Queues_1.id = main.Queue ) WHERE (main.IsMerged IS NULL) AND (main.Status != 'deleted') AND (main.Type = 'ticket') AND (main.Queue = '72' AND ( ( Queues_1.Lifecycle = 'default' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) OR ( Queues_1.Lifecycle = 'assets' AND ( main.Status = 'new' OR main.Status = 'allocated' OR main.Status = 'in-use' ) ) OR ( Queues_1.Lifecycle = 'approvals' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) ) ) ORDER BY main.id ASC LIMIT 50;

一组中有 11 行(0.00 秒)

好的,答案是 "new" Request-Tracker 功能: UseSQLForACLCheck.

禁用此参数return整个性能。