You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current default buffer size is 4K. It is too small.
This buffer size is grow when receiving large packet. But when receiving huge numbers of rows, this size is not grown.
I added a benchmark to query 10k rows in #1415.
I can not find significant performance difference between 4k and 16k buffer.
Maybe, it is because I used virtual network in macbook. (I used Rancher Desktop and Docker MySQL)
I need to run this benchmark with real network.
goos: darwin
goarch: arm64
pkg: github.com/go-sql-driver/mysql
│ buf4k.txt │ buf16k.txt │
│ sec/op │ sec/op vs base │
ReceiveMassiveRows/query-8 5.698m ± ∞ ¹ 5.719m ± ∞ ¹ ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05
│ buf4k.txt │ buf16k.txt │
│ B/op │ B/op vs base │
ReceiveMassiveRows/query-8 859.8Ki ± ∞ ¹ 859.8Ki ± ∞ ¹ ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² need >= 4 samples to detect a difference at alpha level 0.05
│ buf4k.txt │ buf16k.txt │
│ allocs/op │ allocs/op vs base │
ReceiveMassiveRows/query-8 50.00k ± ∞ ¹ 50.00k ± ∞ ¹ ~ (p=1.000 n=1) ²
¹ need >= 6 samples for confidence interval at level 0.95
² all samples are equal
Issue description
Current default buffer size is 4K. It is too small.
This buffer size is grow when receiving large packet. But when receiving huge numbers of rows, this size is not grown.
mysqlclient default buffer size is 16KiB.
https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html#option_mysql_net-buffer-length
The text was updated successfully, but these errors were encountered: