Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
benchmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
benchmark
Commits
b397732b
Commit
b397732b
authored
Feb 26, 2024
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test record
parent
83186670
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
0 deletions
+98
-0
README.md
http/README.md
+15
-0
http_batch.js
http/http_batch.js
+83
-0
No files found.
http/README.md
View file @
b397732b
...
...
@@ -49,6 +49,21 @@
```
console
./k6 run --vus 20 -i 1000 --batch 20000 --batch-per-host 10000 http_batch.js --local-ips '192.168.10.1-192.168.10.99'
```
| 序号 | k6 | kong | api-backend | delay 10s | 1.5M | k6 速率 | req_failed | data_received |
|:--: | :---: | :----: | :----: | :----: | :----: | :----: | :----: | :----: |
|1 | 220 | 220 | 220 | | | 24808.401989/s | 0.0% | |
|2 | 220 | 220 | 220 | 1 | | 1055.079942/s | 5.58% | |
|3 | 220 | 220 | 220 | | 1 | 1701.379022/s | 0.00% | 2.7 GB/s |
|3 | 220 | 220 | 220 | 1 | 1 | 618.755198/s | 2.16% | 953 MB/s |
...
...
http/http_batch.js
0 → 100644
View file @
b397732b
import
http
from
'
k6/http
'
;
import
{
check
}
from
'
k6
'
;
export
default
function
()
{
/*
array[i] = http.asyncRequest('POST', 'http://192.168.1.220:8000/api/v1/demianhjw/aigic/0129', {
"model_name": "Realistic_Vision_V1.4",
"model_type": "tex2img",
"desc": {
"prompt": " a small car",
"steps": 20
}
}, { headers:
{ "Content-Type": "application/json",
"apikey":"6r9aCCENYah5KPARJ4GLFmlOLs0uAEr2",
"async":"true"}
});
}
./k6 run --vus 100 -i 100 --batch 2000 --batch-per-host 1000 http_batch.js --local-ips '192.168.10.1-192.168.10.99'
./k6 run --vus 30 -d 100s --batch 20000 --batch-per-host 10000 http_batch.js --local-ips '192.168.10.1-192.168.10.99'
*/
let
array
=
new
Array
(
1000
);
for
(
let
i
=
0
;
i
<
array
.
length
;
i
++
)
{
array
[
i
]
=
{
method
:
'
POST
'
,
url
:
'
http://192.168.1.220:8000/api/v1/demianhjw/aigic/0129
'
,
body
:
{
"
model_name
"
:
"
Realistic_Vision_V1.4
"
,
"
model_type
"
:
"
tex2img
"
,
"
desc
"
:
{
"
prompt
"
:
"
a small car
"
,
"
steps
"
:
20
}
},
params
:
{
headers
:
{
"
Content-Type
"
:
"
application/json
"
,
"
apikey
"
:
"
6r9aCCENYah5KPARJ4GLFmlOLs0uAEr2
"
,
"
async
"
:
"
true
"
},
},
};
}
const
responses
=
http
.
batch
(
array
);
// httpbin.test.k6.io should return our POST data in the response body, so
// we check the third response object to see that the POST worked.
// check(responses[0], {
// 'form data OK': (res) => JSON.parse(res.body)['form']['hello'] == 'world!',
// });
const
res
=
Promise
.
all
(
array
)
check
(
res
,
{
"
status is 200
"
:
(
r
)
=>
r
.
status
===
200
,
// "is key correct": (r) => j.json.key === "value",
});
}
// export let options = {
// stages: [
// // Ramp-up from 1 to 5 VUs in 10s
// { duration: "20s", target: 2000 },
// // Stay at rest on 5 VUs for 5s
// { duration: "10s", target: 1000 },
// // Ramp-down from 5 to 0 VUs for 5s
// { duration: "15s", target: 0 }
// ]
// };
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment