承接 namelesscoder/asynchronous-reference-indexing 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

namelesscoder/asynchronous-reference-indexing

Composer 安装命令:

composer require namelesscoder/asynchronous-reference-indexing

包简介

README 文档

README

Delegates reference index updating to an asynchronous queue, processed by CLI / scheduler

What does it do?

Provides a couple of things:

  • An override class for DataHandler which replaces a single method, updateRefIndex, causing on-the-fly indexing to be skipped, instead delegating to a queue.
  • A similar override for the ReferenceIndex class which replaces methods called also outside of DataHandler, to catch those cases.
  • An SQL table storing queued reference index updates.
  • A CommandController which can be executed via CLI to process queued reference indexing without running into timeout or long wait issues.
  • Provides option to exclude tables from reference indexing (only on TYPO3 8.6+). See extension configuration.

Depending on how often your editors perform record imports, copies, deletions etc. this can over time save many, many hours of waiting for the TYPO3 backend to respond.

For further information about the performance aspects see the "Background" section below.

Installing

Only available through Packagist (or via GitHub). Installation via Composer is recommended:

composer require namelesscoder/asynchronous-reference-indexing

Then enable the extension in TYPO3. This can be done with a CLI command:

TYPO3_PATH_ROOT=$PWD/web vendor/bin/typo3 extensionmanager:extension:install asynchronous_reference_indexing

Word of warning

Failing to update the reference index can have negative effects on your site in some cases, both in frontend and backend. You are advised to add a scheduler task or cronjob for the included command controller and set the frequency to a very low value such as once every minute. The controller maintains a lock file and prevents parallel executions, so frequent runs are safe.

Note that this extension consistently captures all of the current reference indexing, including that which you can trigger using the existing (non-Extbase) CLI command or via the "DB check" backend module which is added when you install the lowlevel system extension. Using either of these methods to force reference index updating will instead fill the queue for the command controller included with this extension so that all existing records which have relations will be processed on the next run.

Possible side effects

Delaying update of the reference index has one main side effect: if the editor tries to delete a record whose relations have not been indexed, an appropriate warning may not be shown.

Secondary side effect is in listing of relationships between records. Such information will be updated only when the command controller runs.

Frontend rendering should not be affected negatively.

Usage

To re-index a site from scratch you would normally execute the following command, if you have a lot of garbage in the sys_refindex table you might wan't to truncate it before:

TYPO3_PATH_ROOT=$PWD/web vendor/bin/typo3cms asyncreferenceindex:update --force 1

Afterwards you can update the sys_refindex by executing the command:

TYPO3_PATH_ROOT=$PWD/web vendor/bin/typo3cms asyncreferenceindex:update

Alternatively you can setup a Scheduler Task to execute the command at a certain interval.

Background

This community extension exists for one reason alone: increasing responsiveness of the TYPO3 backend when performing record operations. Due to the internal structure of the ReferenceIndex class in TYPO3, any record operation which might potentially change references causes an extreme amount of SQL traffic.

At the time of writing this (2016-12-04) the problem can be illustrated as follows:

  • Assume you use sys_category relations for 10,000 different records (from any table to one sys_category)
  • Updating, importing, deleting or copying any record pointing to this sys_category triggers index update
  • Index update itself cascades to process all 10,000 sys_category records for every record you edited
  • Depending on the number of records you edited this may cause hundreds of thousands of SQL requests

A significant effort has already been made to improve the reference indexing performance, however, all improvements are inevitably minor without a complete rewrite of the entire reference indexing logic. Again, at the time of writing this, the ReferenceIndex and RelationHandler classes are mutually dependent and will recursively call each other, thus further compounding the performance problem described above. Since these technical challenges are very hard to overcome, this extension is presented as a temporary solution to increase responsiveness of record operations in TYPO3 by upwards of 90% reduction in wall time.

You read that right. 90% - nine-zero percent.

Credit

This work and all preceding investigation was sponsored by Systime. Systime is a Danish online publishing firm specialising in "i-books" for the educational market, and they faced severe problems with reference indexing in particular.

References

(performance profiles not linked as they are not permanently online)

namelesscoder/asynchronous-reference-indexing 适用场景与选型建议

namelesscoder/asynchronous-reference-indexing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29.54k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 12 月 04 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 namelesscoder/asynchronous-reference-indexing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 namelesscoder/asynchronous-reference-indexing 我们能提供哪些服务?
定制开发 / 二次开发

基于 namelesscoder/asynchronous-reference-indexing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 29.54k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2016-12-04