企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
参考:https://learnku.com/articles/4765/simple-primary-stress-test [TOC] ### 1.安装压测工具 ``` yum install httpd-tools #安装完就可以使用压测命令 ab ``` ### 2.压测 ``` ab -c 4000 -n 100000 http://tasks.io/ ``` 出现如下异常: ``` # Benchmarking tasks.io (be patient) # socket: Too many open files (24) ``` 打开文件过多,使用 `ulimit -n 204800 ` ``` # Benchmarking tasks.io (be patient) # apr_socket_recv: Connection reset by peer (104) ``` 高并发下,会被系统认为是攻击 ``` > vim /etc/sysctl.conf net.ipv4.tcp\_syncookies = 0 > sysctl -p ```