So, running three lines of Ruby code via "bundle exec rails runner" takes about 20 seconds on my VM. (Ok, admittedly, the first line calls Sidekiq::Stats.new ...)

Is there any common way to speed this up?

(I mean, starting Mastdodon's tootctl basically suffers the same problem, but I don't need that as often...)

Haha, that was almost easy. Originally I used this old code: github.com/t-cyrill/munin-side

I have no real idea how this stuff works, but since the script is being started in my mastodon/live environment, I assume bundle exec rails runner ... pulls in all requirements from the Mastodon gemfile?

I now explicitly require 'sidekiq/api' in the small script that's being run, and instead of going through rails I run ruby directly, using bundle exec ruby -e "${RUBY_SCRIPT}"

Completes almost immediately.

Show thread
Follow

I'm unreasonably happy about this small success, since I was just about convinced I'd totally lost my ability to solve problems that I don't really understand.

Sign in to participate in the conversation
INFRa Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!