v2.3.0: Improved performance, subscription quantity limit, and more
This is a long-awaited release. Nice to meet you again in the changelog! This is the last release that supports Python 3.7, and there will not be any patch version for the v2.3.x series. Any fixes will only be applied to the next release, which will bump the minimum Python version requirement to 3.9.
Performance enhancements
- Support for Python 3.11: Released in 2022-10-24, Python 3.11 is 10–60% (on average 25%) faster than Python 3.10. RSStT now supports Python 3.11 and the official Docker image is based on Python 3.11.
- CPU: Decrease the load average by ~30% (depends on the usage scenario). Thanks to a dependency migration from pure Python
fuzzwuzz
to C-extensionrapidfuzz
and a lot of performance tuning. - Memory: (Docker image only) Reduce memory consumption and improve memory allocation performance by adopting
jemalloc
. - Multicore CPU: If the environment variable
MULTIPROCESSING
is set to1
, multiple processes will be started. The number of processes is equal to the cores of CPU, but the maximum is 3. One is the main process, the others (if any) are used to parse RSS feeds, etc. Note that it is only valid when there are more than 1 CPU core, otherwise only 1 process (main process) will be started. It may help improve the performance on multicore CPUs but consumes more memory. Usually you don't need to enable it. However, if there are tons of subscriptions or your VPS comes with multiple cores but the performance of each is poor, you may want to enable this feature. - Bandwidth usage: Work around an upstream (
uvloop
) bug that causes the bot to use too much bandwidth. Compared to previous releases, it cuts down up to 75% bandwidth usage whenuvloop
enabled. - Startup time: Decrease the startup time by increasing the startup concurrency and putting some unimportant startup tasks into the background.
- Minor enhancements: Some internal functions have been optimized to improve performance.
Additions
Highlights
- Subscription quantity limit: The maximum number of subscriptions per user is now configurable (default: unlimited). By using the
/set_option
command, you can setuser_sub_limit
andchannel_or_group_sub_limit
. To check or set the limit of a specific user/channel/group, use the/user_info
command. - Monitor watchdog: A watchdog has been implemented to check if the feed monitor is properly running. If not, the watchdog will exit the bot. Docker, Railway or Heroku will have it automatically restarted.
Other additions
- Leave chat if been banned: If the bot has not the permission to send messages in a channel/group, it will leave the chat.
<q>
tag as quotation marks: A<q>
tag is now converted to quotation marks (<q>I am a quote,</q> said Q.
->“I am a quote,” said Q.
).- New l10n: Multiple translations have been added.
Enhancements & bug fixes
- Accept 4-char usernames: You can now use the 4-char username of your channel/group in "remote" commands.
- Ignore inline query header in commands: Formerly, if the bot is not properly set up as an inline bot, commands would be sent with an inline query header (
@bot_username
), causing the bot not to respond. Now the bot will ignore the inline query header and respond to commands correctly. - Skip monitoring tasks if flood waiting: If the bot is unable to send messages to all subscribers of a feed due to rate limit, it will skip the monitoring task for that feed once.
- Exit gracefully: If the bot receives SIGINT or SIGTERM, it will exit gracefully by closing the database connections first. Formerly, unclosed database connections would block the bot from exiting.
- Encoding detection: Fix a bug resulting in incorrect encoding detection for some feeds.
- Drop
sr-only
elements: Dropsr-only
elements from the RSS feed. They are only for screen readers and should not be rendered. - Fix mistaken command regex: Fix some mistaken command regexes preventing the bot from responding commands correctly.
Minor bug fixes & changes
More unmentioned minor bugs have been fixed in the release. The changelog does not include all the changes. For more details, please refer to the compare view.
v2.3.0: 改进的性能、订阅数量限制等
这是一个期待已久的版本。很高兴在变更日志中再次相遇!这是支持 Python 3.7 的最后一个版本,v2.3.x 系列不会有任何补丁版本。任何修复都将只应用于下一个版本,且下一个版本将使 Python 的最低版本要求提高到 3.9。
性能增强
- 对 Python 3.11 的支持:Python 3.11 于 2022-10-24 发布,速度比 Python 3.10 快 10-60% (平均 25%)。RSStT 现在支持 Python 3.11,官方 Docker 镜像也基于 Python 3.11。
- CPU:将平均负载降低约 30%(取决于使用场景)。这要归功于将依赖
fuzzwuzz
(纯 Python) 迁移到rapidfuzz
(C 扩展) 以及大量的性能调校。 - 内存:(仅适用于 Docker 镜像)采用
jemalloc
降低内存消耗,提高内存分配性能。 - 多核 CPU:如果环境变量
MULTIPROCESSING
设置为1
,将启动多个进程。进程的数量将等于 CPU 核心数,但最大值为 3。一个是主进程,其它进程(如果有的话)用于解析 RSS 提要等。请注意,只有当有 1 个以上的 CPU 核心时,该选项才有效,否则将只启动 1 个进程(主进程)。它可能有助于在多核 CPU 上提升性能,但会消耗更多内存。通常你不需要启用它。但是,如果有大量订阅,或者您的 VPS 有多个核心,但每个核心的性能都很差,您可能需要启用此功能。 - 带宽使用:变通解决上游(
uvloop
)的 bug,这导致 bot 使用过多的带宽。与之前的版本相比,当启用uvloop
时,可以减少高达 75% 的带宽使用。 - 启动时间:通过增加启动时的并发性,将一些不重要的启动任务放到后台,来减少启动时间。
- 小的功能增强:一些内部功能已进行了优化,以提高性能。
新特性
亮点
- 订阅数量限制:现在可以配置每个用户的最大订阅数量(默认值:无限制)。通过使用
/set_option
命令,可以设置user_sub_limit
(普通用户的订阅数量限制) 和channel_or_group_sub_limit
(频道或群组的订阅数量限制)。要为特定用户/频道/群组检查或设置订阅数量限制,请使用/user_info
命令。 - 监视器看门狗:已经实现了一个看门狗来检查订阅源监视器是否正常运行。如果没有,看门狗将使 bot 退出。Docker、Railway 或 Heroku 将自动重新启动它。
其他新特性
- 如果被封禁,则离开聊天:如果 bot 没有在频道/群组中发送消息的权限,它将离开聊天。
<q>
标签转换为引号:<q>
标签现在会被转换为引号(<q>I am a quote,</q> said Q.
->“I am a quote,” said Q.
)。- 新的本地化:添加了多个翻译。
增强和 bug 修复
- 接受 4 个字符的用户名:现在可以在 “远程” 命令中使用 4 个字符的用户名来指定频道/群组。
- 忽略命令中的 inline query header:先前,如果 bot 没有被正确设置为 inline bot,命令会带着 inline query header (
@bot_username
) 发送,导致 bot 没有响应。现在, bot 将忽略 inline query header 并正确响应命令。 - 如果正等待速率控制,则跳过监控任务:如果 bot 由于速率限制而无法向订阅源的所有订阅者发送消息,则会跳过该订阅源的监控任务一次。
- 优雅地退出:如果 bot 接受到 SIGINT 或 SIGTERM,它将通过首先关闭数据库连接来优雅地退出。先前,未关闭的数据库连接会阻止 bot 退出。
- 编码检测:修复导致某些订阅源的编码检测不正确的错误。
- 删除
sr-only
元素:从 RSS 源中删除sr_only
元素。它们仅用于屏幕阅读器,不应被渲染。 - 修复错误的命令正则表达式:修复一些错误的命令正则表达式,它们使 bot 无法正确响应命令。
次要的 bug 修复和更改
更多未提及的小 bug 已在该版本被修复。变更日志不包括所有变更。有关更多详细信息,请参阅比较视图。