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

MAM-3095-load-test-20k-simulate #205

Merged
merged 5 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.production.sample
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ ACCOUNT_RELAY_KEY=xxxxxx
# JWT Decode MAMMOTH AUTHENTICATION
MAMMOTH_SECRET_KEY=xxxxxx

# Multiple number of users to load test the ForYouMammothFeed Scheduler
FOR_YOU_LOAD_TEST_MULTIPLIER=1
7 changes: 6 additions & 1 deletion app/workers/scheduler/for_you_mammoth_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ class Scheduler::ForYouMammothScheduler

sidekiq_options retry: 0

LOAD_TEST_MULTIPLIER = ENV['FOR_YOU_LOAD_TEST_MULTIPLIER'].to_i || 1

Rails.logger.warn "ForYouMammothScheduler LOAD TEST:: x#{LOAD_TEST_MULTIPLIER}" if LOAD_TEST_MULTIPLIER > 1

def perform
users = mammoth_users.wait
users.each do |acct|
users.flat_map { |u| [u] * LOAD_TEST_MULTIPLIER }
.each do |acct|
UpdateForYouWorker.perform_async({ acct: acct, rebuild: false })
end
end
Expand Down