Skip to content
Snippets Groups Projects
Verified Commit f30c62e3 authored by Denis Smirnov's avatar Denis Smirnov
Browse files

feat(stress test): improve the amount of routers

parent f76e9c2d
No related branches found
No related tags found
1 merge request!1414sbroad import
import tarantool from "k6/x/tarantool";
import {randomItem} from 'https://jslib.k6.io/k6-utils/1.1.0/index.js';
const client = tarantool.connect("localhost:3301", {"user": "admin", pass: "app-cluster-cookie"})
const clients = [
tarantool.connect("localhost:3301", {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect("localhost:3306", {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect("localhost:3307", {"user": "admin", pass: "app-cluster-cookie"}),
tarantool.connect("localhost:3308", {"user": "admin", pass: "app-cluster-cookie"})
]
export let current_server = 0
function get_client() {
let c = clients[current_server]
current_server += 1
if (current_server >= clients.length) {
current_server = 0
}
return c
}
let ids = Array.from(
{
......@@ -21,5 +37,5 @@ const pattern = `SELECT *
WHERE "reestrid" = ?`
export default () => {
tarantool.call(client, "query", [pattern, [randomItem(ids)]]);
tarantool.call(get_client(), "query", [pattern, [randomItem(ids)]]);
}
\ No newline at end of file
---
test_app.router:
test_app.router-1:
advertise_uri: localhost:3301
http_port: 8081
readahead: 16711680
test_app.router-2:
advertise_uri: localhost:3306
http_port: 8086
readahead: 16711680
test_app.router-3:
advertise_uri: localhost:3307
http_port: 8087
readahead: 16711680
test_app.router-4:
advertise_uri: localhost:3308
http_port: 8088
readahead: 16711680
test_app.s1-master:
advertise_uri: localhost:3302
http_port: 8082
readahead: 16711680
test_app.s1-replica:
advertise_uri: localhost:3303
http_port: 8083
readahead: 16711680
test_app.s2-master:
advertise_uri: localhost:3304
http_port: 8084
readahead: 16711680
test_app.s2-replica:
advertise_uri: localhost:3305
http_port: 8085
readahead: 16711680
test_app-stateboard:
listen: localhost:4401
......
router:
router-1:
instances:
- router
- router-1
roles:
- failover-coordinator
- vshard-router
- app.roles.api
all_rw: false
router-2:
instances:
- router-2
roles:
- failover-coordinator
- vshard-router
- app.roles.api
all_rw: false
router-3:
instances:
- router-3
roles:
- failover-coordinator
- vshard-router
- app.roles.api
all_rw: false
router-4:
instances:
- router-4
roles:
- failover-coordinator
- vshard-router
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment