English 中文(简体)
为什么在提出许多要求时,申请本身就没有变化?
原标题:why does an application hangs itself when there are many requests?

I do not understand why application goes down when there are too many requests? How can I test my application for its maximum capacity to respond to a requests?

最佳回答

我不理解为什么在要求太多的时候,申请会减少?

如果你要求具体应用,答案就是我们不知道什么,我们没有任何证据可以推断问题是什么。 寻找证据的地点:

  • Check server the logs.
  • If you have a reverse proxy, check the proxy s logs.
  • Check the backend database logs.
  • Check the system-level performance stats; e.g. look for evidence of VM thrashing, disc I/O overload and so on.
  • Check for pathological GC behavior.
  • Check for blocked / jammed threads, indicating concurrency bottlenecks, deadlocks and so on.

If you are asking in the general case, there can be any number of causes:

  • Running out of an external resource (e.g. database connections)
  • Creating too many threads
  • Trying to queue every request to avoid dropping requests, and other broken strategies.
  • Concurrency bottlenecks
  • Pathological algorithm or database query design that results in performance that decays under load.
  • Broken error recovery; e.g. underload you start getting unexpected exceptions, and this triggers resource leaks.
  • And so on ...

以及我如何测试我的申请,使其具有最大能力回应请求......

Create a test harness to repeatedly send requests to your server and see what rate the server can sustain. There are existing freameworks for doing this.

问题回答

为什么你认为申请被放弃? 难道它只是采取一些长期行动吗?

“太多要求”的音响,例如,你要么没有资源(例如与非行的联系),但你应当看到一些例外情况在案件记录中有所追溯,或者你有某种一致性的问题。

To know for sure, you need to make thread dump and see if all threads are doing what you expect them to do. You can pay attention to threads of your application only at the start (database threads, logic and servlet threads), as it somewhat unlikely that Tomcat or SQL server has some bug inside them. Try to find place where your application stop behaving as you expect it to, by looking into logs (or adding them, if needed).





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签