典型的网络套接字超时
我很想知道当今生产中使用的典型网络套接字超时值是多少。
我目前在 Java 应用程序中使用了 30 秒,但想听听其他用途,特别是对于互联网通信。
谢谢。
I'm interested to know, what is the typical network socket timeout value, used in production today.
I'm currently using 30 seconds in our Java application, but would like to hear what other using, especially for Internet communications.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不存在所谓的“典型”套接字超时。相反,您应该根据应用程序要求选择超时。诸如以下问题:
最好的策略可能是选择一些直观上合理的值,然后调整它们。
There is no such thing as a "typical" socket timeout. Rather you should chose the timeout(s) according to the application requirements. Issues such as:
The best strategy is probably to pick some intuitively sensible values, and then tune them.
没有共同的值,它在很大程度上取决于应用程序(每小时发送多少条消息,发送的消息越多,超时就越短)和所使用的网络(通过互联网的超时时间比通过本地网络的超时时间长)。
There is no common value, it heavily depends on the application (how many messages are sent per hour, the more messages being sent the lower your timeout can be) and the network used (longer timeout over the internet than over a local network).
根据经验,您可以使用双倍的事务预期响应时间。但肯定不存在“典型”超时这样的事情。
As a rule of thumb you can use double the expected response time for the transaction. But there is certainly no such thing as a 'typical' timeout.