DEV Community

ChungWei Wei
ChungWei Wei

Posted on • Originally published at kmp.tw on

[Linux] ab test Get Errors

Situation

When Use ab Command, Client & Server Return Error MSG

  • ### Server
    • ### apr_socket_recv: Connection reset by peer (104)
  • ### Client
    • ### socket: Too many open files (24)

Solutions

Server Error

$ vim /etc/sysctl.conf

net.ipv4.tcp_syncookies = 0

$ sysctl -p
Enter fullscreen mode Exit fullscreen mode

Client Error

$ ulimit -a
Enter fullscreen mode Exit fullscreen mode
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         0
-m: resident set size (kbytes)      unlimited
-u: processes                       62302
-n: file descriptors                1024
-l: locked-in-memory size (kbytes)  65536
-v: address space (kbytes)          unlimited
-x: file locks                      unlimited
-i: pending signals                 62302
-q: bytes in POSIX msg queues       819200
-e: max nice                        0
-r: max rt priority                 0
-N 15:                              unlimited

Enter fullscreen mode Exit fullscreen mode

Set -n : file descriptors

ulimit -n 204800
Enter fullscreen mode Exit fullscreen mode

Top comments (0)