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

Bullやめる #12037

Open
syuilo opened this issue Oct 15, 2023 · 5 comments
Open

Bullやめる #12037

syuilo opened this issue Oct 15, 2023 · 5 comments
Labels
packages/backend Server side specific issue/PR

Comments

@syuilo
Copy link
Member

syuilo commented Oct 15, 2023

Summary

バッチ処理機能とか使いたいけど有料なため

@syuilo syuilo added the packages/backend Server side specific issue/PR label Oct 15, 2023
@u1-liquid
Copy link
Contributor

flowsでは代替できないような作業?

@syuilo
Copy link
Member Author

syuilo commented Oct 16, 2023

できない作業というか、パフォーマンスを向上させたい

@syuilo
Copy link
Member Author

syuilo commented Oct 16, 2023

あとこれの問題がある
#11000

@u1-liquid
Copy link
Contributor

現在queueでやってる作業(主にAPの処理)は各ジョブの開始や完了に必要なコストが高いわけではないと思うので、batch処理にしても性能的面では特に変わらない可能性が高いと思う
(既にbullmq上で決まった数のjobをfetchして実行するようになってるので、concurrencyを上げたのとそんなに変わらない挙動になると思う)

あのIssueに関しては、bullとのアーキテクチャの差によるキュー処理の設定値の調整が必要だったのと、bullmqに最適ではない実装の仕方が原因だと思う

前者に関してはRate limitに掛かったときちょっと変わった挙動をするので、limitに掛からないようにすると改善する

後者に関してはissueにも言及されてあるが署名の検証、JSONのパースなどは非常にCPU-heavyな作業で、内部的にSingle Threadで動くNodeにはそれらの並列処理は重い処理となってしまっていることと、上で挙げたRate Limitの挙動のことが重なってDelayedのジョブが溜まり、CPUが同時に処理できるジョブの数を超えるとStalled処理がほぼ常に走ってしまうという形でconcurrencyを食い潰してしまうなどの問題がある

ので、今の実装のままだと別のqueue実装にするとしても改善できるパフォーマンスは限定的ではないかなと思う

@tamaina
Copy link
Contributor

tamaina commented Jan 5, 2024

MisskeyIO#313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
Development

No branches or pull requests

3 participants