Windows 上的 MySQL 命名管道——更快的最佳实践,还是坏主意?

发布于 2024-07-19 06:00:57 字数 1066 浏览 4 评论 0原文

最近,我一直喜欢在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

乖不如嘢 2024-07-26 06:00:57

尝试查看 http://msdn.microsoft.com/ en-us/library/aa178138(SQL.80).aspx

即使它谈论的是 MS SQL Server,在内核模式下运行的本地命名管道应该仍然适用

来自上述链接:

澄清是否您也很重要
正在谈论本地管道或
网络管道。 如果服务器
应用程序在本地运行
运行实例的计算机
Microsoft® SQL Server™ 2000,本地
命名管道协议是一个选项。
本地命名管道在内核模式下运行
而且速度非常快。

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:

It is also important to clarify if you
are talking about local pipes or
network pipes. If the server
application is running locally on the
computer running an instance of
Microsoft® SQL Server™ 2000, the local
Named Pipes protocol is an option.
Local named pipes runs in kernel mode
and is extremely fast.

天赋异禀 2024-07-26 06:00:57

我做了一个快速测试 - 将数据库转储到文件中并在我的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文