[GH-ISSUE #2041] Frp is too slow by KCP mode #1623

Closed
opened 2026-05-05 13:02:13 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @marvinpan8 on GitHub (Oct 28, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/2041

version

0.34.1

go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build168222576=/tmp/go-build -gno-record-gcc-switches"

frps.ini

[common]
bind_addr = 0.0.0.0
bind_port = 8098
kcp_bind_port = 8098
dashboard_addr = 0.0.0.0
dashboard_port = 7500
dashboard_user = XXXXXXX
dashboard_pwd = XXXXXX
enable_prometheus = true
log_file = /usr/logs/frp/frps.log
log_level = info
log_max_days = 3
disable_log_color = false
detailed_errors_to_client = true
authentication_method = token
authenticate_heartbeats = false
authenticate_new_work_conns = false
token = XXXXXXXX
allow_ports = 6000,8000-9999
max_pool_count = 5
max_ports_per_client = 0
tls_only = true
tcp_mux = true

frpc.ini

[common]
token = XXXXXXXX
server_addr = <public IP>
server_port = 8098
log_file = ./frpc.log
log_level = info
log_max_days = 3
disable_log_color = false
admin_addr = 192.168.10.129
admin_port = 8566
admin_user = XXXXXX
admin_pwd = XXXXXXX
pool_count = 5
tcp_mux = true
user = XXXXXX
login_fail_exit = false
protocol = kcp
tls_enable = true
meta_var1 = 123451234
meta_var2 = 234512314
meta_oracluser = 412341234123
meta_oraclpassword = 41234124312
[ssh]
type = tcp
local_ip = 192.168.10.211
local_port = 3306
bandwidth_limit = 1MB
use_compression = true
remote_port = 8068
group = test_group
group_key = XXXXX
health_check_type = tcp
health_check_timeout_s = 3
health_check_max_failed = 3
health_check_interval_s = 10
meta_var1 = XXXX
meta_var2 = XXXXX
meta_ssh = XXXXXXXX

Steps to reproduce the issue

  1. frps -c /etc/frp/frps.ini
  2. frpc -c /etc/frp/frpc.ini
  3. test Mysql batch insert data

Describe the results you received:

Insert about 1000 record per 15 second, it is too slow

2020-10-28 13:01:52 INFO [datax] 2917 Insert count 2987008 / 4462692 => 66%
2020-10-28 13:02:15 INFO [datax] 2918 Insert count 2988032 / 4462692 => 66%
2020-10-28 13:02:38 INFO [datax] 2919 Insert count 2989056 / 4462692 => 66%
2020-10-28 13:03:01 INFO [datax] 2920 Insert count 2990080 / 4462692 => 67%
2020-10-28 13:03:24 INFO [datax] 2921 Insert count 2991104 / 4462692 => 67%
2020-10-28 13:03:47 INFO [datax] 2922 Insert count 2992128 / 4462692 => 67%
2020-10-28 13:04:09 INFO [datax] 2923 Insert count 2993152 / 4462692 => 67%
2020-10-28 13:04:32 INFO [datax] 2924 Insert count 2994176 / 4462692 => 67%

Describe the results you expected:

Intranet Direct Mysql DB as below. It is 3000 Record per one second. So frp expected to be 2000 +

2020-10-26 16:58:23 INFO [datax] 21 Insert count 21504 / 35809 => 60%
2020-10-26 16:58:23 INFO [datax] 22 Insert count 22528 / 35809 => 62%
2020-10-26 16:58:24 INFO [datax] 23 Insert count 23552 / 35809 => 65%
2020-10-26 16:58:24 INFO [datax] 24 Insert count 24576 / 35809 => 68%
2020-10-26 16:58:24 INFO [datax] 25 Insert count 25600 / 35809 => 71%
2020-10-26 16:58:25 INFO [datax] 26 Insert count 26624 / 35809 => 74%
2020-10-26 16:58:25 INFO [datax] 27 Insert count 27648 / 35809 => 77%
2020-10-26 16:58:25 INFO [datax] 28 Insert count 28672 / 35809 => 80%

Can you point out what caused this issue

Mybe caused by Network, But I open the KCP, Why also is slow,slow ....

Originally created by @marvinpan8 on GitHub (Oct 28, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/2041 ### version 0.34.1 ### go env ``` GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/root/.cache/go-build" GOENV="/root/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/root/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/root/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build168222576=/tmp/go-build -gno-record-gcc-switches" ``` ### frps.ini ``` [common] bind_addr = 0.0.0.0 bind_port = 8098 kcp_bind_port = 8098 dashboard_addr = 0.0.0.0 dashboard_port = 7500 dashboard_user = XXXXXXX dashboard_pwd = XXXXXX enable_prometheus = true log_file = /usr/logs/frp/frps.log log_level = info log_max_days = 3 disable_log_color = false detailed_errors_to_client = true authentication_method = token authenticate_heartbeats = false authenticate_new_work_conns = false token = XXXXXXXX allow_ports = 6000,8000-9999 max_pool_count = 5 max_ports_per_client = 0 tls_only = true tcp_mux = true ``` ### frpc.ini ``` [common] token = XXXXXXXX server_addr = <public IP> server_port = 8098 log_file = ./frpc.log log_level = info log_max_days = 3 disable_log_color = false admin_addr = 192.168.10.129 admin_port = 8566 admin_user = XXXXXX admin_pwd = XXXXXXX pool_count = 5 tcp_mux = true user = XXXXXX login_fail_exit = false protocol = kcp tls_enable = true meta_var1 = 123451234 meta_var2 = 234512314 meta_oracluser = 412341234123 meta_oraclpassword = 41234124312 [ssh] type = tcp local_ip = 192.168.10.211 local_port = 3306 bandwidth_limit = 1MB use_compression = true remote_port = 8068 group = test_group group_key = XXXXX health_check_type = tcp health_check_timeout_s = 3 health_check_max_failed = 3 health_check_interval_s = 10 meta_var1 = XXXX meta_var2 = XXXXX meta_ssh = XXXXXXXX ``` ### Steps to reproduce the issue 1. frps -c /etc/frp/frps.ini 2. frpc -c /etc/frp/frpc.ini 3. test Mysql batch insert data ### Describe the results you received: Insert about 1000 record per 15 second, it is too slow ``` 2020-10-28 13:01:52 INFO [datax] 2917 Insert count 2987008 / 4462692 => 66% 2020-10-28 13:02:15 INFO [datax] 2918 Insert count 2988032 / 4462692 => 66% 2020-10-28 13:02:38 INFO [datax] 2919 Insert count 2989056 / 4462692 => 66% 2020-10-28 13:03:01 INFO [datax] 2920 Insert count 2990080 / 4462692 => 67% 2020-10-28 13:03:24 INFO [datax] 2921 Insert count 2991104 / 4462692 => 67% 2020-10-28 13:03:47 INFO [datax] 2922 Insert count 2992128 / 4462692 => 67% 2020-10-28 13:04:09 INFO [datax] 2923 Insert count 2993152 / 4462692 => 67% 2020-10-28 13:04:32 INFO [datax] 2924 Insert count 2994176 / 4462692 => 67% ``` ### Describe the results you expected: Intranet Direct Mysql DB as below. It is 3000 Record per one second. So frp expected to be 2000 + ``` 2020-10-26 16:58:23 INFO [datax] 21 Insert count 21504 / 35809 => 60% 2020-10-26 16:58:23 INFO [datax] 22 Insert count 22528 / 35809 => 62% 2020-10-26 16:58:24 INFO [datax] 23 Insert count 23552 / 35809 => 65% 2020-10-26 16:58:24 INFO [datax] 24 Insert count 24576 / 35809 => 68% 2020-10-26 16:58:24 INFO [datax] 25 Insert count 25600 / 35809 => 71% 2020-10-26 16:58:25 INFO [datax] 26 Insert count 26624 / 35809 => 74% 2020-10-26 16:58:25 INFO [datax] 27 Insert count 27648 / 35809 => 77% 2020-10-26 16:58:25 INFO [datax] 28 Insert count 28672 / 35809 => 80% ``` ### Can you point out what caused this issue Mybe caused by Network, But I open the KCP, Why also is slow,slow ....
gitea-mirror 2026-05-05 13:02:13 -06:00
Author
Owner

@fatedier commented on GitHub (Nov 2, 2020):

It's normal if you connect your mysql with frp in public network. It can't as fast as you connect mysql directly.

<!-- gh-comment-id:720211854 --> @fatedier commented on GitHub (Nov 2, 2020): It's normal if you connect your mysql with frp in public network. It can't as fast as you connect mysql directly.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 18, 2020):

Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.

<!-- gh-comment-id:747807871 --> @github-actions[bot] commented on GitHub (Dec 18, 2020): Issues go stale after 45d of inactivity. Stale issues rot after an additional 10d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1623
No description provided.