Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker load_tests #2387

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions load_tests/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function get_options() {
load_test: {
executor: 'constant-arrival-rate',
duration: '60s',
preAllocatedVUs: 100,
preAllocatedVUs: 10, // not enough RAM for 100 VUs
rate: 1,
timeUnit: '1s',
},
Expand Down Expand Up @@ -68,13 +68,16 @@ export default function run() {
const headers = { 'Content-Type': 'application/json' };
const query = shareGPT[scenario.iterationInTest % shareGPT.length];
const payload = JSON.stringify(generate_payload(query, max_new_tokens));
const res = http.post(`http://${host}/v1/chat/completions`, payload, {
const res = http.post(`https://${host}/v1/chat/completions`, payload, {
headers,
});
if (res.status >= 400 && res.status < 500) {
return;
}

if (res.status !== 200) {
console.error(res.body);
}

check(res, {
'Post status is 200': (res) => res.status === 200,
Expand Down
12 changes: 12 additions & 0 deletions load_tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:

# How to run:
# HOST=..... docker compose up
tgi_load_test:
image: grafana/k6
command: run /load_tests/common.js
environment:
- HOST=${HOST}
- MODEL_ID=${MODEL_ID}
volumes:
- ./:/load_tests:Z
Loading