我使用k6进行负载测试,运行的命令为k6 run --stage 5s:250 script.js,script.js 的内容如下:
import { check } from 'k6';
import http from "k6/http";
export default function main(token) {
let res = http.get(
"https://{domain}/schedules"
);
check(res, {
'is status 200': (r) => r.status === 200
});
}
但是输出出现了大量的socket: too many open files,如下图所示:

服务是基于 Spring Boot 的,使用 Nginx 作为 reverse proxy 。要怎么解决“socket: too many open files”这个问题呢?
我尝试过按照ck :: Nginx socket() failed (24: Too many open files)进行修改,但是没有效果。