Increase the execution interval for the tracker stats importer

オープン
#565 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@josecelano がすでに取り組んでいます。

2024年4月24日 から。

評価

この issue はまだ評価されていません。

説明

Optimization

Relates to: https://github.com/torrust/torrust-demo/issues/1

There is a background task that imports torrent stats from the Tracker. The Tracker Statistics Importer checks every 100 milliseconds if there are torrents to import. It executes a SQL query to fetch torrents that have not been updated in the last hour:


	"torrent_id"	INTEGER NOT NULL,
	"tracker_url"	VARCHAR(256) NOT NULL,
	"seeders"	INTEGER NOT NULL DEFAULT 0,
	"leechers"	INTEGER NOT NULL DEFAULT 0,
	"updated_at"	TEXT DEFAULT 1000-01-01 00:00:00,
	FOREIGN KEY("torrent_id") REFERENCES "torrust_torrents"("torrent_id") ON DELETE CASCADE,
	UNIQUE("torrent_id","tracker_url"),
	PRIMARY KEY("torrent_id")
);

The field updated_at stores the last update date. You can configure the importer in the config file:

[tracker_statistics_importer]
torrent_info_update_interval = 3600

That configuration means the Index should try to update torrents at least every hour.

It seems querying the database every 100 milliseconds is overloading the demo server. Although it's a tiny instance, we should increase the interval. It could be a configuration option or even calculated manually in the future.

According to the data I've collected we could increase it from 100 milliseconds to 2000 milliseconds.

主要言語
Rust
スター
100
フォーク
28
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

torrust/torrust-index のほかの issue

torrust/torrust-index の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。