Windows 上的 MySQL 命名管道——更快的最佳实践,还是坏主意?
最近,我一直喜欢在 Windows 上运行的 MySQL 中使用命名管道(选项 --enable-named-pipes),并通过 .NET 连接器驱动程序进行连接。 出于安全目的,通常建议使用它,但它允许我做的一件事是与“.”连接。 作为连接字符串并在我的 PC 上开发并部署到服务器,而无需更改连接字符串(指向服务器主机而不是我自己的数据库副本)。
不仅如此,根据我的经验,我将一些加速归因于相对于 TCP 的延迟优势。 我在网上找到的一些参考资料表明:
我们使用命名管道成功测试了 MySQL 5.0,这真是太棒了。 速度增加! 对于这个大项目来说 50% 首先可能是 使用 MySQL 的最新 JConnector 驱动程序是个好主意
http://www.waltercedric.com/component/内容/文章/1217.html
在简单的性能测试中,命名管道访问似乎是 比标准 TCP/IP 访问快 30%-50%。 然而,这 每个系统各不相同,并且命名管道在许多方面比 TCP/IP 慢 Windows 配置。
http: //dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html
但是在什么“配置”中它会更慢? 不管怎样,我一直假设本地主机访问比 TCP 更快,但是,我还没有找到任何明确的信息。 也许它也更具体于所使用的特定驱动程序。
Lately I've been favoring using named pipes (option --enable-named-pipes) in MySQL running on windows, and connect via the .NET connector driver. It's often recommended for security purposes, but one thing it allows me to do is connect with "." as the connection string and develop on my PC and deploy to the server without having to change the connection string (to point to the server host instead of my own copy of the DB).
More than that, in my experience there is some speedup I've attributed to a latency advantage over TCP. Some references I've found online echo that:
We were testing successfuly MySQL 5.0 using named pipe, and what an
increase in speed! 50% in the case of this big project First it may be
a good idea to use the latest JConnector driver from MySQL
http://www.waltercedric.com/component/content/article/1217.html
In simple performance tests, it appears that named pipe access is
between 30%-50% faster than the standard TCP/IP access. However, this
varies per system, and named pipes are slower than TCP/IP in many
Windows configurations.
http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html
But in what "configurations" is it slower? Anyway, I've been proceeding on the assumption that it's faster for localhost access vs TCP, however, I haven't been able to find anything definitive. Perhaps it's more specific to the particular driver being used too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试查看 http://msdn.microsoft.com/ en-us/library/aa178138(SQL.80).aspx
即使它谈论的是 MS SQL Server,在内核模式下运行的本地命名管道应该仍然适用
来自上述链接:
Try looking at http://msdn.microsoft.com/en-us/library/aa178138(SQL.80).aspx
Even though it speaks about MS SQL Server, the Local named pipes running in kernel mode should still apply
From the aforementioned link:
我做了一个快速测试 - 将数据库转储到文件中并在我的 XP 开发机器上重新导入它。
没有显示出任何差异 - 结果保持不变。
什么会影响命名管道变慢或变快?
谢谢
I did a quick test - dumping a db to a file and reimporting it on my XP dev machine.
No difference showed - results remained the same.
What would influence named pipes to be slower or faster?
Thanks