Changing the load balancing algorithm to selecting the node (among k fastest nodes) that has the max jusi number
Changing the load balancing algorithm to selecting the node (among k fastest nodes) that has the max jusi number : https://github.com/DoctorLai/steem-load-balancer/pull/41
The node first checks whether a previously selected node is still valid (i.e., the cached entry hasn’t expired). If it is valid, the request is directly forwarded to that node. Otherwise, the system sends a get_version request to the candidate nodes listed in config.nodes. Among the first config.firstK nodes (default: 1), the node with the highest jussi_num value is selected, cached, and used for subsequent requests.
PR: Refactor and Add another test when k < 0 https://github.com/DoctorLai/steem-load-balancer/pull/42
PR: Return the max jussi_num node from firstK https://github.com/DoctorLai/steem-load-balancer/pull/41
Latest image has been updated to docker hub https://hub.docker.com/r/justyy/steem-load-balancer/tags
async function firstKFulfilled(promises, k) { return new Promise((resolve) => { const fulfilled = []; let settledCount = 0; const total = promises.length;if (k <= 0) return resolve([]); if (total === 0) return resolve([]); promises.forEach((p) => { Promise.resolve(p) .then((value) => { fulfilled.push(value); if (fulfilled.length === k) { resolve(fulfilled); // early resolve once k succeeded } }) .catch(() => {}) .finally(() => { settledCount++; // if everything has settled and we never reached k if (settledCount === total && fulfilled.length < k) { resolve(fulfilled); } }); });
});
}
Steem to the Moon🚀!
- You can rent Steem Power via rentsp!
- You can swap the TRON:TRX/USDT/USDD to STEEM via tron2steem!
- You can swap the STEEM/SBD to SUI via steem2sui!
- You can swap the STEEM/SBD to SOL Solana via steem2sol!
- You can swap the STEEM/SBD to ETH Ethereum via steem2eth!
- You can swap the STEEM/SBD to Tether USDT (TRC-20) via steem2usdt!
- You can swap the STEEM/SBD to TRX (TRON) via steem2trx!
- You can swap the STEEM/SBD to BTS (BitShares) via steem2bts!
- Register a free STEEM account at SteemYY!
- Steem Block Explorer
- ChatGPT/Steem Integration: You can type !ask command to invoke ChatGPT
- Steem Witness Table and API
- Other Steem Tools
Support me, thank you!
Why you should vote me? My contributions
Please vote me as a witness or set me as a proxy via https://steemitwallet.com/~witnesses