简体   繁体   English

通过域名而不是IP地址通过本地网络连接到数据库时,会产生大量开销吗?

[英]Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network?

Is there a substantial overhead when connect to a database by the domain name instead of the IP Address, over a local network? 通过域名而不是IP地址通过本地网络连接到数据库时,会产生大量开销吗?

I have an application server that is will be connecting to a mongodb server running on a separate instance, but the same local network. 我有一个应用程序服务器,该服务器将连接到在单独实例但具有相同本地网络上运行的mongodb服务器。 Is there substantial overhead for the DNS lookup? DNS查找有大量开销吗?

For example: 例如:

[ app ] -- 1.1.1.1:27017 --> [ Mongo ] [ app ] 1.1.1.1:27017 > [ Mongo ]

VS VS

[ app ] -- mongo.example.com:27017 --> [ Mongo ] [ app ] mongo.example.com:27017 > [ Mongo ]

EDIT 编辑

Is it generally considered a best practice to use the IP Address instead of the Domain name? 通常认为使用IP地址代替域名是一种最佳做法吗?

More info: 更多信息:

Thank you! 谢谢!

There will be an occasional, possibly significant, delay to look up the name. 查找名称有时会出现延迟,可能会很长时间。 But the result will then be cached on any decent OS, so most connections won't have to wait on a DNS lookup. 但是结果将被缓存在任何合适的操作系统上,因此大多数连接都不必等待DNS查找。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM