Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

dcelasun
Copy link

@dcelasun dcelasun commented Jun 1, 2025

Performance improvements

After the first run, only fetch recently active torrents. This improves RPC response times for Transmission instances with thousands of torrents.

This is a port of @leijurv's work from his fork. Including the new metrics, peersSendingToUs and downloadedEver. Unlike that commit, I did not make any backwards incompatible changes.

Instance and job support for Grafana

This adds instance and job filters to the dashboard so if you have multiple exporters running you can choose which one(s) to view.

Here's how it looks:
image
image

I also adjusted a few panel widths for consistency.

Peers UL (uploading to us)

I also updated the stats table to make use of the new peersSendingToUs metric:
image

This closes #32.

dcelasun added a commit to dcelasun/pkgbuilds that referenced this pull request Jun 1, 2025
dcelasun added 5 commits June 1, 2025 15:04
This adds instance and job filters[1] to the dashboard so if you
have multiple exporters running you can choose which one(s) to view.

[1] https://prometheus.io/docs/concepts/jobs_instances/
After the first run, only fetch recently active torrents. This will
improve RPC response times for Transmission instances with thousands of
torrents.

This is a port of leijurv's work[1] from his fork. Unlike that commit, I
did not make any backwards incompatible changes.

[1] metalmatze@c143ddb
This makes use of the new metric added in 5aac42a.
@dcelasun dcelasun force-pushed the feat/perf-dashboard-improvements branch from e0633c5 to b0a0d7d Compare June 1, 2025 14:04
@leijurv
Copy link

leijurv commented Jun 1, 2025

It's been a long time so I legitimately don't remember: what backwards incompatible changes did I make?

also for what it's worth I slightly regret having added the per torrent metrics because now my prometheus is 300gb lol

@dcelasun
Copy link
Author

dcelasun commented Jun 2, 2025

It's been a long time so I legitimately don't remember: what backwards incompatible changes did I make?

You dropped some metrics like leechers & seeders.

also for what it's worth I slightly regret having added the per torrent metrics because now my prometheus is 300gb lol

Yeah, it's a disk hog for sure :)

These are floats in the RPC even though they contain integers, like 100.0.

Without this change JSON unmarshalling fails.
@bagusnl
Copy link

bagusnl commented Jun 15, 2025

Heyya, good work on the improvements!

I've tested the build locally and on my case, the "Torrent" field is a bit of a problem as it will error the grafana out
422: too long query; got 49098 bytes; mustn't exceed -search.maxQueryLen=16384 bytes

I have a modest 649 entries, though some with a long names so its kind of a problem. Removing the filter works for me.
Everything else is fine so far, will update if I find any issue on mine, thanks for the work!

@dcelasun
Copy link
Author

Heyya, good work on the improvements!

Glad you like it! I tested against a server with 347 entries, so I must have avoided the query length issue. I'll see if I can do anything about that. Maybe we can restrict the set somehow.

@bagusnl
Copy link

bagusnl commented Jun 17, 2025

I store my metrics under VictoriaMetrics and so far it adds about 200-300MB per-day just from the transmission exporter itself. Which is fine by me. But one of my suggestion is to use stats is it possible to use total uploaded instead of average uploaded in the stats table? or maybe change one of them like total uploaded 30d?
My transmission activity is not that much so the average upload speed doesn't really reflect much on the individual entry activities.

image

@dcelasun
Copy link
Author

But one of my suggestion is to use stats is it possible to use total uploaded instead of average uploaded in the stats table? or maybe change one of them like total uploaded 30d?

I can add a second table, Torrent stats minimal that only uses transmission_torrent_uploaded_ever. You can then delete the full Torrent stats dashboard from Grafana and update your Prometheus config to drop the transmission_torrent_upload_bytes metric.

Does that sound OK?

@bagusnl
Copy link

bagusnl commented Jun 17, 2025

I can add a second table, Torrent stats minimal that only uses transmission_torrent_uploaded_ever. You can then delete the full Torrent stats dashboard from Grafana and update your Prometheus config to drop the transmission_torrent_upload_bytes metric.

Sounds good by me, but for the transmission_torrent_upload_bytes I can keep as the per-torrent upload graph looks neat

@dcelasun
Copy link
Author

OK, just pushed an updated Grafana config. I split the dashboard into 2 rows. The first row (the one you're all used to) now has this torrent table:
image
As you can see, current and average upload columns are gone. These depend on the transmission_torrent_upload_bytes metric, which is fairly expensive.

The old table is in a new "Extended statistics" row, hidden by default:
image

If you don't want this at all / would like to reduce Prometheus storage costs, just delete that row and add this to the transmission-exporter job in your Prometheus config:

metric_relabel_configs:
  - source_labels: [ __name__ ]
    regex: 'transmission_torrent_upload_bytes'
    action: drop

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

I have made a fork that improves performance with many torrents, and fixes the lastScapeTimedOut issue

3 participants