我的問題是一樣的this question和this question的httperf文件描述符限制
我basicly想在試圖用這樣的並聯連接10000的httperf運行[的httperf --uri/--server 192.168.1.2 --port 8080 --num-conns = 500000 --rate 10000]
我在Ubuntu 14.04上運行它。
首先,我提高了系統的文件描述符限制,這是在我的所以現在配置:
$ ulimit -a -S
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 31348
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65530
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 31348
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
$ulimit -a -H
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 31348
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65530
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 31348
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
我試圖編譯從GitHub存儲庫中的HEAD版本,但它似乎是完全地不穩定。
我也嘗試0.9.0版本修改的限制(更改/usr/include/x86_64-linux-gnu/bits/typesizes.h解鎖FD_SETSIZE 1024)像其他問題的答案一樣。重新編譯後,它一直返回相同的錯誤的httperf:
*** buffer overflow detected ***: ./httperf terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x73f1f)[0x7fdca440ef1f]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fdca44a682c]
/lib/x86_64-linux-gnu/libc.so.6(+0x10a6f0)[0x7fdca44a56f0]
/lib/x86_64-linux-gnu/libc.so.6(+0x10b777)[0x7fdca44a6777]
./httperf[0x403c69]
./httperf[0x4047e7]
./httperf[0x4088df]
./httperf[0x408d2e]
./httperf[0x4071df]
./httperf[0x40730b]
./httperf[0x406791]
./httperf[0x405e0e]
./httperf[0x409afd]
./httperf[0x406022]
./httperf[0x404c1f]
./httperf[0x4024ac]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fdca43bcec5]
./httperf[0x40358b]
======= Memory map: ========
00400000-00410000 r-xp 00000000 08:05 265276
0060f000-00610000 r--p 0000f000 08:05 265276
00610000-00611000 rw-p 00010000 08:05 265276
00611000-0068a000 rw-p 00000000 00:00 0
019da000-01c8f000 rw-p 00000000 00:00 0 [heap]
7fdca4185000-7fdca419b000 r-xp 00000000 08:06 3277773 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdca419b000-7fdca439a000 ---p 00016000 08:06 3277773 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdca439a000-7fdca439b000 rw-p 00015000 08:06 3277773 /lib/x86_64-linux-gnu/libgcc_s.so.1
7fdca439b000-7fdca4556000 r-xp 00000000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
7fdca4556000-7fdca4756000 ---p 001bb000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
7fdca4756000-7fdca475a000 r--p 001bb000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
7fdca475a000-7fdca475c000 rw-p 001bf000 08:06 3279540 /lib/x86_64-linux-gnu/libc-2.19.so
7fdca475c000-7fdca4761000 rw-p 00000000 00:00 0
7fdca4761000-7fdca4866000 r-xp 00000000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
7fdca4866000-7fdca4a65000 ---p 00105000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
7fdca4a65000-7fdca4a66000 r--p 00104000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
7fdca4a66000-7fdca4a67000 rw-p 00105000 08:06 3279556 /lib/x86_64-linux-gnu/libm-2.19.so
7fdca4a67000-7fdca4a8a000 r-xp 00000000 08:06 3279536 /lib/x86_64-linux-gnu/ld-2.19.so
7fdca4c63000-7fdca4c66000 rw-p 00000000 00:00 0
7fdca4c85000-7fdca4c89000 rw-p 00000000 00:00 0
7fdca4c89000-7fdca4c8a000 r--p 00022000 08:06 3279536 /lib/x86_64-linux-gnu/ld-2.19.so
7fdca4c8a000-7fdca4c8b000 rw-p 00023000 08:06 3279536 /lib/x86_64-linux-gnu/ld-2.19.so
7fdca4c8b000-7fdca4c8c000 rw-p 00000000 00:00 0
7ffff050b000-7ffff052c000 rw-p 00000000 00:00 0 [stack]
7ffff05fe000-7ffff0600000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
我不是低級別的系統調用,如選擇familliar,但據我可以告訴htperf 0.9.0使用選擇處理套接字事件和此係統調用受限於硬編碼的1024個文件描述符限制。 所以你們有什麼想法我做錯了什麼?我怎樣才能解鎖1024限制?
拆分不是一個壞主意,不幸的是,httperf不支持可以完成這項工作的多處理。在httperf文檔中明確指出,它不能同時運行兩個httperf進程。 – Thiago
我在想多個線程,但是它也可能會受到限制。在內核和進程中掃描10k個文件描述符需要時間。要小心。 –