aliyundrive-subscribe icon indicating copy to clipboard operation
aliyundrive-subscribe copied to clipboard

[功能]支持套接字本地连接Nginx和MySQL,性能更强

Open msycn opened this issue 2 years ago • 0 comments

对于本地数据库连接,确实有两种常见的连接方式:TCP/IP连接和Unix套接字。Unix套接字通常只能用于在同一台机器上的进程间通信,而TCP/IP连接可以用于跨网络通信。

Unix套接字在本地通信时通常比TCP/IP连接有更高的性能,因为它避免了网络协议栈的开销。然而,这种性能提升在许多应用中可能并不明显,除非你的数据库查询非常频繁,或者对性能有特别高的要求。

root:pass@unix(/tmp/mysql.sock)/database?charset=utf8&parseTime=True&loc=Local

这样不需要经过tcp协议打包后,再解包. 隔壁alist支持后性能有10倍以上提升!https://github.com/alist-org/alist/issues/4671 (7d20a)

msycn avatar Jul 18 '23 18:07 msycn