From aa2ce188d102ab38452df316d06286040b5d9075 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 17 Jun 2022 14:34:37 +0200 Subject: Optimize view endpoint --- scripts/simulate-many-viewers.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/simulate-many-viewers.ts b/scripts/simulate-many-viewers.ts index fb666c318..a993e175a 100644 --- a/scripts/simulate-many-viewers.ts +++ b/scripts/simulate-many-viewers.ts @@ -46,10 +46,12 @@ async function prepare () { } } + const env = { PRODUCTION_CONSTANTS: 'true' } + servers = await Promise.all([ - createSingleServer(1, config, { nodeArgs: [ '--inspect' ] }), - createSingleServer(2, config), - createSingleServer(3, config) + createSingleServer(1, config, { env, nodeArgs: [ '--inspect' ] }), + createSingleServer(2, config, { env }), + createSingleServer(3, config, { env }) ]) await setAccessTokensToServers(servers) @@ -81,7 +83,7 @@ async function runViewers () { await Bluebird.map(viewers, viewer => { return servers[0].views.simulateView({ id: videoId, xForwardedFor: viewer.xForwardedFor }) - }, { concurrency: 100 }) + }, { concurrency: 500 }) console.log('Finished to run views in %d seconds.', (new Date().getTime() - before) / 1000) -- cgit v1.2.3