Skip to content

Commit

Permalink
Remove default limit on max tcp connections by setting max-conns-per-…
Browse files Browse the repository at this point in the history
…host to 0 (#1909)

* change default value of max-conns-per-host to 0 [unlimited]

* remove max-conns-per-host flag from presubmit perf test script to allow comparison of performance

* review comment

* remove max-conns-per-host flag from perf scripts
  • Loading branch information
ashmeenkaur authored May 16, 2024
1 parent f535453 commit 6516028
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,10 @@ func newApp() (app *cli.App) {

cli.IntFlag{
Name: "max-conns-per-host",
Value: 100,
Value: 0,
Usage: "The max number of TCP connections allowed per server. This is " +
"effective when --client-protocol is set to 'http1'.",
"effective when --client-protocol is set to 'http1'. The default value" +
" 0 indicates no limit on TCP connections (limited by the machine specifications)",
},

cli.IntFlag{
Expand Down
1 change: 1 addition & 0 deletions flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (t *FlagsTest) Defaults() {
ExpectEq("", f.TempDir)
ExpectEq(2, f.RetryMultiplier)
ExpectFalse(f.EnableNonexistentTypeCache)
ExpectEq(0, f.MaxConnsPerHost)

// Logging
ExpectTrue(f.DebugFuseErrors)
Expand Down
2 changes: 1 addition & 1 deletion perfmetrics/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cd gcsfuse/perfmetrics/scripts
```
4. Create a directory and mount your GCS bucket into it using GCSFuse:
```bash
GCSFUSE_FLAGS="--implicit-dirs --max-conns-per-host 100 --client-protocol http1"
GCSFUSE_FLAGS="--implicit-dirs --client-protocol http1"
BUCKET_NAME=your-bucket-name
mkdir -p your-directory-name
MOUNT_POINT=your-directory-name
Expand Down
2 changes: 1 addition & 1 deletion perfmetrics/scripts/compare_fuse_types_using_fio.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from absl import app

GCSFUSE_REPO = 'https://github.com/GoogleCloudPlatform/gcsfuse'
GCSFUSE_FLAGS="--implicit-dirs --max-conns-per-host 100"
GCSFUSE_FLAGS = "--implicit-dirs"


def _install_gcsfuse(version, gcs_bucket, gcsfuse_flags) -> None:
Expand Down
2 changes: 1 addition & 1 deletion perfmetrics/scripts/continuous_test/gcp_ubuntu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ then
UPLOAD_FLAGS="--upload_gs"
fi

GCSFUSE_FLAGS="--implicit-dirs --max-conns-per-host 100 --debug_fuse --debug_gcs --log-format \"text\" "
GCSFUSE_FLAGS="--implicit-dirs --debug_fuse --debug_gcs --log-format \"text\" "
LOG_FILE_FIO_TESTS=${KOKORO_ARTIFACTS_DIR}/gcsfuse-logs.txt
GCSFUSE_FIO_FLAGS="$GCSFUSE_FLAGS --log-file $LOG_FILE_FIO_TESTS --stackdriver-export-interval=30s"
BUCKET_NAME="periodic-perf-tests"
Expand Down
9 changes: 5 additions & 4 deletions perfmetrics/scripts/ls_metrics/listing_benchmark_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,21 +593,22 @@ def test_unmount_gcs_bucket_error(self, mock_subprocess_call):

@patch('listing_benchmark.subprocess.call', return_value=0)
def test_mount_gcs_bucket(self, mock_subprocess_call):
directory_name = listing_benchmark._mount_gcs_bucket('fake_bucket', '--implicit-dirs --max-conns-per-host 100')
directory_name = listing_benchmark._mount_gcs_bucket('fake_bucket',
'--implicit-dirs')
self.assertEqual(directory_name, 'fake_bucket')
self.assertEqual(mock_subprocess_call.call_count, 2)
self.assertEqual(mock_subprocess_call.call_args_list, [
call('mkdir fake_bucket', shell=True),
call('gcsfuse --implicit-dirs --max-conns-per-host 100 fake_bucket fake_bucket', shell=True)
call('gcsfuse --implicit-dirs fake_bucket fake_bucket', shell=True)
])

@patch('listing_benchmark.subprocess.call', return_value=1)
def test_mount_gcs_bucket_error(self, mock_subprocess_call):
listing_benchmark._mount_gcs_bucket('fake_bucket', '--implicit-dirs --max-conns-per-host 100')
listing_benchmark._mount_gcs_bucket('fake_bucket', '--implicit-dirs')
self.assertEqual(mock_subprocess_call.call_count, 3)
self.assertEqual(mock_subprocess_call.call_args_list, [
call('mkdir fake_bucket', shell=True),
call('gcsfuse --implicit-dirs --max-conns-per-host 100 fake_bucket fake_bucket', shell=True),
call('gcsfuse --implicit-dirs fake_bucket fake_bucket', shell=True),
call('bash', shell=True)
])

Expand Down
1 change: 0 additions & 1 deletion perfmetrics/scripts/ml_tests/pytorch/run_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ echo "Mounting GCSFuse..."
nohup /pytorch_dino/gcsfuse/gcsfuse --foreground \
--stackdriver-export-interval=60s \
--implicit-dirs \
--max-conns-per-host=100 \
--config-file $config_filename \
$TEST_BUCKET gcsfuse_data > "run_artifacts/gcsfuse.out" 2> "run_artifacts/gcsfuse.err" &

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ echo "logging:
" > /tmp/gcsfuse_config.yaml
nohup gcsfuse/gcsfuse --foreground \
--implicit-dirs \
--max-conns-per-host 100 \
--stackdriver-export-interval 60s \
--config-file /tmp/gcsfuse_config.yaml \
gcsfuse-ml-tf-data myBucket > /home/output/gcsfuse.out 2> /home/output/gcsfuse.err &
Expand Down
2 changes: 1 addition & 1 deletion perfmetrics/scripts/presubmit_test/pr_perf_test/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ git fetch origin -q

function execute_perf_test() {
mkdir -p gcs
GCSFUSE_FLAGS="--implicit-dirs --max-conns-per-host 100"
GCSFUSE_FLAGS="--implicit-dirs"
BUCKET_NAME=presubmit-perf-tests
MOUNT_POINT=gcs
# The VM will itself exit if the gcsfuse mount fails.
Expand Down

0 comments on commit 6516028

Please sign in to comment.