早起きしちゃったのでスパム目玉焼きわよー
This account is not set to public on notestock.
これかしらね…
$ find vendor/bundle/ruby/3.0.0/gems/scout_apm-2.6.8 -type f -print0 | xargs -0 grep 'def find_by'
vendor/bundle/ruby/3.0.0/gems/scout_apm-2.6.8/lib/scout_apm/instruments/active_record.rb: def find_by_sql_with_scout_instruments(*args, &block)
@nacika 署名したり検証するあたりあんまりログが出ないのでログを眺めてるだけじゃ動作を把握しづらいですよねー。結果が楽しみw
脳死モンキーパッチじゃ効果があったんだかどうだかわからなかったね…
https://github.com/zunda/mastodon/blob/14f6a47/config/initializers/scout_active_record.rb
ってScout gemずいぶんバージョンアップしてるじゃないのよもー
https://github.com/scoutapp/scout_apm_ruby
正しくはこうでした
$ bundle update --conservative scout_apm
:
Installing scout_apm 4.1.2 (was 2.6.8) with native extensions
Bundle updated!
これで直ったかな?
$ find vendor/bundle/ruby/3.0.0/gems/scout_apm-4.1.2 -type f -print0 | xargs -0 grep 'def find_by'
vendor/bundle/ruby/3.0.0/gems/scout_apm-4.1.2/lib/scout_apm/instruments/active_record.rb: def find_by_sql_with_scout_instruments(*args, **kwargs, &block)
ruby-3.0.2のブランチにマージ行くよー
12cb6ed46 (upstream/main) Update Dockerfile (#16696)
3d98f31c6 Fix some Rails frameworks being unnecessarily loaded (#16725)
db57bff11 Stop setting a shortcode to newly-created media attachments (#16730)
\Master?/ \ますたー/
Merged mastodon/mastodon at 12cb6ed46167bf62ceade2a16e55e233a90f13d4 on ruby-3.0.2.
$ bundle update --conservative scout_apm
:
Installing scout_apm 4.1.2 (was 2.6.8) with native extensions
Bundle updated!
でなおりました。
Ubuntu 18.04.5 LTSでーす
5 updates can be applied immediately.
3 of these updates are standard security updates.
To see these additional updates run: apt list --upgradable
$ sudo sh -c 'apt update && apt dist-upgrade -y'
:
The following packages will be upgraded:
base-files git git-man libmysqlclient20 motd-news-config python-apt-common
python3-apt python3-distupgrade ubuntu-release-upgrader-core
update-notifier-common wireless-regdb
11 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 standard security updates
:
増えたw ん、git?
$ cat /var/run/reboot-required*
cat: '/var/run/reboot-required*': No such file or directory
まいっか
This account is not set to public on notestock.
> -exec {} + は (-print0 | xargs -0 と同じくらい)速い
そうなのか!!
POSIX 準拠のシェルスクリプトでは find | xargs よりも find -exec {} + を使うべき!
https://qiita.com/ko1nksm/items/9ff1f212255e8520070c
ほんとだ!!
mastodonのワーキングコピーで速い版
$ time sh -c 'find . -type f -print0 | xargs -0 grep -q find_by'
real 0m1.272s
user 0m0.720s
sys 0m0.896s
$ time sh -c 'find . -type f -exec grep -q find_by {} +'
real 0m1.534s
user 0m0.579s
sys 0m0.952s
遅い版
$ time sh -c 'find . -type f -exec grep -q find_by {} \;'
real 2m3.175s
user 1m19.998s
sys 0m41.571s
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
This account is not set to public on notestock.
ローカルにMastodonのspecを走らせるとJITの有無は実行時間に影響しなかった。他にボトルネックがあるのかな?まあテストが落ちないのはいいことだ。
$ bundle exec rspec
Randomized with seed 13222
3202/3202 |====================== 100 =======================>| Time: 00:06:22
$ RUBYOPT='--jit --jit-max-cache=10000' bundle exec rspec
Randomized with seed 7554
3202/3202 |====================== 100 =======================>| Time: 00:06:24
$ heroku config:set RUBYOPT='--jit --jit-max-cache=10000'
うりゃ
$ heroku ps:exec 'ls -lh /tmp'
total 25M
-rw------- 1 u42390 dyno 13M Sep 14 06:02 _ruby_mjit_hp255u0.h.gch
-rw------- 1 u42390 dyno 13M Sep 14 06:01 _ruby_mjit_hp29u0.h.gch
dr-------- 2 u42390 dyno 4.0K Sep 14 06:01 mask
おーなんかできてるー
ruby-3.0.2で--jit --jit-max-cache=10000する前(左)とした後(右)の、このインスタンスのPumaとSidekiqが走ってるdynoのメモリ使用量、CPU負荷、レスポンス時間、接続時間の変化。有意な変化は見られないw
Hawaii News Now「妊娠中の女性がコロナウイルス感染症で亡くなりました。赤ちゃんは助かりました。亡くなった女性がワクチンを接種していたかどうかは医療情報保護の観点からお知らせすることができません」「入院したすべての妊婦はワクチンを未接種でした」🤔
This account is not set to public on notestock.
> IDはクラスごとに前半が同じ数字で、末尾の3ケタが出席番号、そしてパスワードは、全員共通で「123456789」
だそうです(パスワードとは)
【告発スクープ】小6女子をいじめ自殺に追い込んだ「一人一台端末」の恐怖 パスワードは全員「123456789」 #プレジデントオンライン https://president.jp/articles/-/49923