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

perf(backend): Use addBulk to add deliver queues #11114

Merged
merged 2 commits into from
Jul 5, 2023
Merged

Conversation

tamaina
Copy link
Contributor

@tamaina tamaina commented Jul 5, 2023

Related to #11000 (comment)

What

DeliverManagerのexecuteからdeliverキューを発行する場合addBulkを使う

Why

ノート・リアクションのフォロワーへの配送で配送すべきサーバーごとにBullMQのaddを呼んでいた。配送すべきサーバーが500あった場合500以上のaddが呼ばれていた。

ラウンドトリップが減ってパフォーマンスをちょっとだけ向上できそうと思ったけど、p1.a9z.devでCPU使用率が減った実感はない

Additional info (optional)

p1.a9z.devに適用

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/backend Server side specific issue/PR label Jul 5, 2023
@tamaina tamaina marked this pull request as ready for review July 5, 2023 02:02
@github-actions github-actions bot requested a review from EbiseLutica July 5, 2023 02:02
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #11114 (eeec1f4) into develop (92d9946) will decrease coverage by 0.03%.
The diff coverage is 77.77%.

@@             Coverage Diff             @@
##           develop   #11114      +/-   ##
===========================================
- Coverage    77.37%   77.35%   -0.03%     
===========================================
  Files          908      907       -1     
  Lines        91675    91610      -65     
  Branches      7550     7551       +1     
===========================================
- Hits         70937    70866      -71     
- Misses       20738    20744       +6     
Impacted Files Coverage Δ
packages/backend/src/core/QueueService.ts 50.00% <70.58%> (+1.70%) ⬆️
...nd/src/core/activitypub/ApDeliverManagerService.ts 98.58% <100.00%> (+1.45%) ⬆️

... and 1 file with indirect coverage changes

@tamaina
Copy link
Contributor Author

tamaina commented Jul 5, 2023

DMもOK

@tamaina tamaina merged commit 22227fa into develop Jul 5, 2023
@tamaina tamaina deleted the deliver-addbulk branch July 5, 2023 03:15
@syuilo
Copy link
Member

syuilo commented Jul 5, 2023

🙏

riku6460 pushed a commit to MisskeyIO/misskey that referenced this pull request Jul 5, 2023
riku6460 added a commit to MisskeyIO/misskey that referenced this pull request Jul 5, 2023
* perf(backend): Use addBulk to add deliver queues (misskey-dev#11114)

* BullMQ -> Bull

---------

Co-authored-by: tamaina <tamaina@hotmail.co.jp>
slofp pushed a commit to Secineralyr/misskey.dream that referenced this pull request Jul 21, 2023
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants