Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v12.111.0における通知周りのスロークエリ及びエラー #8816

Closed
ThinaticSystem opened this issue Jun 12, 2022 · 13 comments · Fixed by #8974
Closed

v12.111.0における通知周りのスロークエリ及びエラー #8816

ThinaticSystem opened this issue Jun 12, 2022 · 13 comments · Fixed by #8974
Labels
⚠️bug? This might be a bug

Comments

@ThinaticSystem
Copy link

ThinaticSystem commented Jun 12, 2022

💡 Summary

このような感じになりバックエンドでCPU負荷がかかります
https://gist.github.com/ThinaticSystem/8f38b08893afa37a680eab5315b01158
https://gist.github.com/frfs/966898716e2ce1bd74a4000b08f86244

📝 Steps to Reproduce

📌 Environment

Misskey version: 12.110.0
OS: Ubuntu 20.04.4 LTS x86_64
Postgresql: 14.3
Node.js: 18.0.0

@ThinaticSystem ThinaticSystem added the ⚠️bug? This might be a bug label Jun 12, 2022
@ThinaticSystem
Copy link
Author

https://mk.f72u.net/notes/91ehm4niiy

しなちへ
多分通知を開くかLTLを開いたら重くなります
ふるふるより #frfr

@tamaina
Copy link
Contributor

tamaina commented Jun 12, 2022

もしかしてここが原因?(私が変えた覚えがあるだけ)

https://github.com/misskey-dev/misskey/blob/12.111.0/packages/backend/src/server/api/endpoints/notifications/read.ts#L37

@mei23
Copy link
Contributor

mei23 commented Jun 12, 2022

ServiceWorkerのイベントで既読が出まくっていて最終的に notifications/read が Array で呼ばれているのでは?と

swNotificationRead.then(that => that.read(data));

swNotificationRead.then(that => that.read(data));

@tamaina
Copy link
Contributor

tamaina commented Jun 12, 2022

いや、

WARN 1 [api] SLOW API CALL DETECTED: i/notifications (4849.911375001073ms)

なのでService Workerとかの周囲は関係ないかも

@mei23
Copy link
Contributor

mei23 commented Jun 12, 2022

i/notifications は最大でも100しか出せないから違うかなって思ったのだわ

@tamaina
Copy link
Contributor

tamaina commented Jun 12, 2022

Service Workerの既読処理キューを空にし忘れていたのが原因かも?

@mi-24v
Copy link

mi-24v commented Jun 12, 2022

同様の問題が発生しましたがコントロールパネルでService Workerのpush通知を切って数時間放置してると負荷が消えました。緩和策になるかもです

2022-06-12 05:38:51 +0900にデプロイして設定を変えたのは多分1時間後ぐらいだったと思います
負荷グラフ

このとき_notification.emptyPushNotificationMessage (en-USPush notifications have been updated、ja-JPでプッシュ通知の更新をしました)がブラウザ上で大量に出たり消えたりしてましたがいまはないっぽいです

📌 Environment

Misskey version: 12.110.0
OS: Amazon Linux 2 x86_64 (ECS最適化AMIami-0beba7dd29d72a203使用)
Postgresql: 12.8
Node.js: 18.0.0
Docker Image: miwpayou0808/misskey:140c64c2

@ThinaticSystem
Copy link
Author

ThinaticSystem commented Jun 12, 2022

honi.club#8819 動かしてみてます
よさそう

@ThinaticSystem
Copy link
Author

honi.club#8819 動かしてみてます よさそう

やっぱり変化ないかも…

@mei23
Copy link
Contributor

mei23 commented Jun 12, 2022

Service Workerの既読処理キューを空にし忘れていたのが原因かも?

たぶんそれ、100個既読にしたら全部で5050個分飛ぶ。

@tamaina
Copy link
Contributor

tamaina commented Jul 5, 2022

これなくなったかしら

@ThinaticSystem
Copy link
Author

image
なくなってないっぽい(@12.112.1)

@ThinaticSystem
Copy link
Author

なおりました!
@mei23 ありがとうございます🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚠️bug? This might be a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants