From c26a4b407bbe783773f5db4dc63ce9b30dd7dd59 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 11 Nov 2018 10:54:47 +0100 Subject: [PATCH] adjust default value of buffer size --- features/policy/policy.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/features/policy/policy.go b/features/policy/policy.go index a93f5b82..8bf26c8c 100644 --- a/features/policy/policy.go +++ b/features/policy/policy.go @@ -87,10 +87,12 @@ func init() { defaultBufferSize = -1 // For pipe to use unlimited size case defaultValue: // Env flag not defined. Use default values per CPU-arch. switch runtime.GOARCH { - case "arm", "arm64", "mips", "mipsle", "mips64", "mips64le": - defaultBufferSize = 16 * 1024 // 16k cache for low-end devices + case "arm", "mips", "mipsle": + defaultBufferSize = 0 + case "arm64", "mips64", "mips64le": + defaultBufferSize = 4 * 1024 // 4k cache for low-end devices default: - defaultBufferSize = 2 * 1024 * 1024 + defaultBufferSize = 512 * 1024 } default: defaultBufferSize = int32(size) * 1024 * 1024 @@ -109,8 +111,8 @@ func SessionDefault() Session { Timeouts: Timeout{ Handshake: time.Second * 4, ConnectionIdle: time.Second * 300, - UplinkOnly: time.Second * 2, - DownlinkOnly: time.Second * 5, + UplinkOnly: time.Second * 1, + DownlinkOnly: time.Second * 1, }, Stats: Stats{ UserUplink: false,