han6565 commented on pull request #3910:
URL: https://github.com/apache/apisix/pull/3910#issuecomment-807906115
> Could you please add some test cases to cover the scene that you said?
ok,I can paste some of my test configuration and test results
in etcd one route like this:
{
"id": "347382218030582023",
"create_time": 1616585537,
"update_time": 1616590678,
"uris": [
"/test"
],
"name": "limit",
"methods": [
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"OPTIONS",
"PATCH"
],
"plugins": {
"limit-count": {
"count": 1000,
"time_window": 1,
"rejected_code": 503,
"policy": "redis-cluster",
"redis_cluster_nodes": [
"cluster1-node1:6379",
"cluster1-node2:6379",
"cluster1-node3:6379"
],
"redis_password": "cluster1-password"
}
},
"upstream": {
"nodes": [
{
"host": "myip",
"port": 9999,
"weight": 1
}
],
"timeout": {
"connect": 6000,
"read": 6000,
"send": 6000
},
"type": "roundrobin",
"pass_host": "pass"
},
"status": 1
}
other route like this:
{
"id": "347382218030582024",
"create_time": 1616585538,
"update_time": 1616590679,
"uris": [
"/test2"
],
"name": "limit2",
"methods": [
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"OPTIONS",
"PATCH"
],
"plugins": {
"limit-count": {
"count": 1000,
"time_window": 1,
"rejected_code": 503,
"policy": "redis-cluster",
"redis_cluster_nodes": [
"cluster2-node1:6379",
"cluster2-node2:6379",
"cluster2-node3:6379"
],
"redis_password": "cluster2-password"
}
},
"upstream": {
"nodes": [
{
"host": "myip",
"port": 9999,
"weight": 1
}
],
"timeout": {
"connect": 6000,
"read": 6000,
"send": 6000
},
"type": "roundrobin",
"pass_host": "pass"
},
"status": 1
}
then I stress test two routes at the same time,i use the go-stress-testing
test the url like this:
./go-stress-testing-mac -c 20 -n 100000 -u http://apisix_ip:9080/test
./go-stress-testing-mac -c 20 -n 100000 -u http://apisix_ip:9080/test2
you can see my error.log it output errror like this:
2021/03/26 11:07:03 [error] 28109#28109: *6443 [lua] limit-count.lua:174:
phase_func(): failed to limit req: failed to get redis
`plugin-limit-count10.73.42.1route122` ttl: ERR invalid password, client:
10.73.42.1, server: , request: "GET /test HTTP/1.1", host: "172.20.4.213:9080"
but the password is correct。
I will upload the error log
[error.log](https://github.com/apache/apisix/files/6209169/error.log)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]