Skip to content

Commit

Permalink
minor scalling tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
adam_unchained committed Sep 8, 2023
1 parent 7979030 commit c71cfd7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/functions/src/scale.settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const highUse = isProdEnv() ? 3 : lowWarm;

export function scale(func: WEN_FUNC | WEN_FUNC_TRIGGER): number {
const scaleSettings = {} as { [key: string]: number };
// Min MEMORY / CPU instance, so high use works well here.
scaleSettings[WEN_FUNC.createMember] = highUse;
scaleSettings[WEN_FUNC.updateMember] = lowWarm;

Expand Down Expand Up @@ -46,14 +47,17 @@ export function scale(func: WEN_FUNC | WEN_FUNC_TRIGGER): number {
scaleSettings[WEN_FUNC.createBatchNft] = lowCold;
scaleSettings[WEN_FUNC.updateUnsoldNft] = lowCold;

// Min MEMORY / CPU instance, so high use works well here.
scaleSettings[WEN_FUNC.orderNft] = highUse;
scaleSettings[WEN_FUNC.validateAddress] = highUse;
scaleSettings[WEN_FUNC.validateAddress] = lowWarm;

scaleSettings[WEN_FUNC.createToken] = lowCold;
scaleSettings[WEN_FUNC_TRIGGER.onTokenStatusUpdate] = lowWarm;
// Min MEMORY / CPU instance, so high use works well here.
scaleSettings[WEN_FUNC_TRIGGER.onTokenTradeOrderWrite] = highUse;
scaleSettings[WEN_FUNC_TRIGGER.onTokenPurchaseCreated] = highUse;
scaleSettings[WEN_FUNC_TRIGGER.onTokenPurchaseCreated] = lowWarm;

// Min MEMORY / CPU instance, so high use works well here.
scaleSettings[WEN_FUNC_TRIGGER.milestoneTransactionWrite] = highUse;
scaleSettings[WEN_FUNC_TRIGGER.nftWrite] = lowWarm;
scaleSettings[WEN_FUNC_TRIGGER.transactionWrite] = lowWarm;
Expand Down Expand Up @@ -87,10 +91,10 @@ export function scaleAlgolia(col: COL): GlobalOptions {
};
// To support concurency.
scaleSettings[COL.COLLECTION] = {
minInstances: highUse,
minInstances: lowWarm,
memory: '512MiB',
cpu: 1,
concurrency: 200,
concurrency: 300,
};
scaleSettings[COL.MEMBER] = {
minInstances: lowWarm,
Expand Down

0 comments on commit c71cfd7

Please sign in to comment.