Http Service崩溃的原因
我们有一个外部系统(不在我的控制之下),上面运行着一个 Http 服务,我们可以使用 Java 的 HttpURLConnection 对象。现在,由于某种原因,服务在调用特定请求
时崩溃。我想知道从客户端角度来看 Http 服务崩溃的可能原因是什么,除了像连接泄漏这样的资源消耗。请注意,当它被同时调用多次(超过 50 次)且负载较小时,就会发生这种情况。如果有人可以提供相同的建议,我将不胜感激。
We have an external system (not under my control) which has a Http Service running on it and we can invoke the service using Java's HttpURLConnection object. Now, for some reason the service crashes upon invocation of a specific request
. Am wondering as to what can be the likely causes of Http Service to crash from the client perspective other than lets say resource hogs like a connection leak. Note that this happens when it is called many times (over 50) at the same time and not under less load. Would highly appreciate if anyone can provide recommendations around the same.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除非笼统地回答,否则这是不可能回答的。
看起来您正在使服务过载,并且过载的服务可能会因多种原因而崩溃,包括:
我看不出列举可能性对你有什么帮助。您确实应该与控制您超载的服务的人员交谈。询问他们您的客户应该进行多少个并发呼叫。
我的建议是减少并行发出的请求数量。该服务(任何服务!)每秒只能处理一定数量的请求。如果超出该容量,您将无法获得更好的服务。相反,您可能会导致性能问题,从而显着降低服务的吞吐量……甚至使其崩溃。
运用你的常识。做一名优秀的网络公民。
This is impossible to answer except with generalities.
It looks like you are overloading the service, and an overloaded service can potentially crash for any number of reasons including:
I can't see how enumerating the possibilities is going to help you. You should really be talking to the people who control the service that you are overloading. Ask them how many concurrent calls your client should be making.
My recommendation is to reduce the number of requests you are making in parallel. The service (any service!) can only cope with a certain number of requests per second. If you exceed that capacity you won't get better service. On the contrary, you are likely to cause performance problems that will significantly reduce the service's throughput ... or even crash it.
Use your common sense. Be a good network citizen.