mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 04:47:45 +08:00
Merge pull request #3828 from ipfs/fix/bump-default-ulimit
Bump default ulimit to 2048
This commit is contained in:
commit
e87ecadd50
@ -5,7 +5,7 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
var ipfsFileDescNum = uint64(1024)
|
||||
var ipfsFileDescNum = uint64(2048)
|
||||
|
||||
func init() {
|
||||
if val := os.Getenv("IPFS_FD_MAX"); val != "" {
|
||||
|
||||
@ -208,7 +208,7 @@ test_launch_ipfs_daemon() {
|
||||
|
||||
args="$@"
|
||||
|
||||
test "$TEST_ULIMIT_PRESET" != 1 && ulimit -n 1024
|
||||
test "$TEST_ULIMIT_PRESET" != 1 && ulimit -n 2048
|
||||
|
||||
test_expect_success "'ipfs daemon' succeeds" '
|
||||
ipfs daemon $args >actual_daemon 2>daemon_err &
|
||||
|
||||
@ -126,11 +126,11 @@ TEST_ULIMIT_PRESET=1
|
||||
test_launch_ipfs_daemon
|
||||
|
||||
test_expect_success "daemon raised its fd limit" '
|
||||
grep "raised file descriptor limit to 1024." actual_daemon > /dev/null
|
||||
grep "raised file descriptor limit to 2048." actual_daemon > /dev/null
|
||||
'
|
||||
|
||||
test_expect_success "daemon actually can handle 1024 file descriptors" '
|
||||
hang-fds -hold=2s 1000 '$API_MADDR'
|
||||
test_expect_success "daemon actually can handle 2048 file descriptors" '
|
||||
hang-fds -hold=2s 2000 '$API_MADDR' > /dev/null
|
||||
'
|
||||
|
||||
test_expect_success "daemon didnt throw any errors" '
|
||||
|
||||
Loading…
Reference in New Issue
Block a user