Created
August 23, 2018 22:41
-
-
Save ferdelamad/f4fafe0224acee84c6f8e02e80ab8cab to your computer and use it in GitHub Desktop.
SDC service testing with Seige
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Testing the last 1 million records to effectively assess the caching | |
//Best RPM = 53.2k | |
//Redis strategy = --maxmemory 512mb --maxmemory-policy allkeys-lru | |
const siege = require("siege"); | |
const randomNumbers = []; | |
const random = (min, max) => Math.floor(Math.random() * max) + min; | |
const arrSize = 150000; | |
for (let i = 0; i < arrSize; i += 1) { | |
randomNumbers.push(random(9000000, 10000000)); | |
} | |
let sieger = siege().on(3004); | |
for (let i = 0; i < randomNumbers.length; i += 1) { | |
sieger = sieger.for(1).times.get(`/api/rooms/${randomNumbers[i]}/roominfo`); | |
} | |
sieger.attack(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment