From 295dea221fefa9570195fdd8c131f6f05fb9c266 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 24 Mar 2017 10:48:11 -0700 Subject: [PATCH 1/2] Bump default ulimit to 2048 License: MIT Signed-off-by: Jeromy --- cmd/ipfs/ulimit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ipfs/ulimit.go b/cmd/ipfs/ulimit.go index fa517f1ea..bfbd04df1 100644 --- a/cmd/ipfs/ulimit.go +++ b/cmd/ipfs/ulimit.go @@ -5,7 +5,7 @@ import ( "strconv" ) -var ipfsFileDescNum = uint64(1024) +var ipfsFileDescNum = uint64(2048) func init() { if val := os.Getenv("IPFS_FD_MAX"); val != "" { From dab716ba02d39ccbfbe2f57506935b71f32e7b59 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 24 Mar 2017 19:05:49 +0100 Subject: [PATCH 2/2] test: fix ulimit tests for 2048 fds License: MIT Signed-off-by: Jakub Sztandera --- test/sharness/lib/test-lib.sh | 2 +- test/sharness/t0060-daemon.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/sharness/lib/test-lib.sh b/test/sharness/lib/test-lib.sh index f556187b4..ac608c049 100644 --- a/test/sharness/lib/test-lib.sh +++ b/test/sharness/lib/test-lib.sh @@ -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 & diff --git a/test/sharness/t0060-daemon.sh b/test/sharness/t0060-daemon.sh index beae67eb5..8f033876e 100755 --- a/test/sharness/t0060-daemon.sh +++ b/test/sharness/t0060-daemon.sh @@ -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" '