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.
カスタム絵文字、すっごくたくさんいただいてた これコピーするのってライセンスどうなるんだろう?(zundaコピーさせていただきました) https://mastodon.zunda.ninja/media/BeA27qqyMftsnFYZV1E
ぼっちインスタンス半年でポスグレ350MBです。マルチテナントのお安いプランなのでクエリの統計とかキャッシュとか無いのだ。
$ heroku pg:info
=== DATABASE_URL, PG_HOBBY_BASIC_URL
Plan: Hobby-basic
Status: Available
Connections: 6/20
PG Version: 9.6.1
Created: 2017-04-20 18:31 UTC
Data Size: 354.1 MB
Tables: 37
Rows: 762312/10000000 (In compliance)
昨日のパンク修理とセーフティチェック、$35って聞いたのにカードの請求$34.99になってた。もしかしたらどこかで浮動小数点数として取り扱ってるのかな?
2週間前に日本Amazonで買った本の請求がやっとカード会社に届きましたよ。時間かかる、というかどっさりまとめて届く感じだね。
$ heroku pg:bloat | grep 'schemaname\|statuses'
type | schemaname | object_name | bloat | waste
table | public | statuses | 1.0 | 6168 kB
:
$ heroku pg:psql
> VACUUM statuses;
VACUUM
Time: 8675.616 ms
> \q
$ heroku pg:bloat | grep 'schemaname\|statuses'
type | schemaname | object_name | bloat | waste
table | public | statuses | 1.0 | 6376 kB
変化なさげ
lo48576/mastodon: Your self-hosted, globally interconnected microblogging community https://github.com/lo48576/mastodon/tree/instance/mastodon.cardina1.red
そんなわけで、 mastodon master 追従勢になりました
This account is not set to public on notestock.
久しぶりに詳細が見えた。/api/v1/timelines/public?local=true に20行で40秒
SELECT "statuses"."id", "statuses"."updated_at" FROM "statuses" LEFT OUTER JOIN "accounts" ON "accounts"."id" = "statuses"."account_id" WHERE ("statuses"."local" = ? OR "statuses"."uri" IS NULL) AND "statuses"."visibility" = ? AND (statuses.reblog_of_id IS NULL) AND (statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id) AND "accounts"."silenced" = ? ORDER BY "statuses"."id" DESC LIMIT ?
/app/controllers/application_controller.rb in cache_collection at line 89
/app/controllers/api/v1/timelines/public_controller.rb in cached_public_statuses at line 20
/app/controllers/api/v1/timelines/public_controller.rb in load_statuses at line 16
/app/controllers/api/v1/timelines/public_controller.rb in show at line 9
This account is not set to public on notestock.
@zundan 時報か天気ボットでも入れてLTLを微妙に賑やかすと一発で解決するんでは。
あとaccounts へのjoinをin(select...) に置き換えると実行時間が44%下がります。
https://gist.github.com/tateisu/58d8e566f67a2cd3aa999c7c4b5e6ee1
このインデックス入れるとLTLが過疎ってる場合のAPI応答性が大幅に改善しますが、インデックスを増やすことによるコスト増加と見合うかどうかは人によると思います。
https://gist.github.com/tateisu/58d8e566f67a2cd3aa999c7c4b5e6ee1
パーシャルインデックス試すのにデータベースのコピーして5回くらいは測定しつつでもいつやるんだとか思ってたらみんなさっさとプロダクション環境にw
This account is not set to public on notestock.
てか、あれ?ぼっちインスタンスでローカルタイムラインって僕も含めてあんまり役立たずな子なのでほうっておいてもいいのかな?同様のクエリがHTLとかFTLでもはしるのかな?