What determines number of simultaneous connections

前端 未结 6 1601
予麋鹿
予麋鹿 2021-01-31 19:06

In a Java servlet environment, what are the factors that are the bottleneck for number of simultaneous users.

  1. Number of HTTP connections the server can allow per
6条回答
  •  旧巷少年郎
    2021-01-31 19:11

    You should also consider that the use case itself is limiting the amount of concurrency. Imagine a collaborative environment where the order of actions matters. This forces you to synchronize actions - even if you would have been able to process all of them at once.

    In java land this could be a simple thing as sharing a single resource which is using blocking access. (e.g. shared Random number generators (not per thread), shared Vectors, concurrent structures like ConcurrentHashMap etc.).

    The more synchronization the less you will be able to fully utilize your server hardware.

    So apart from running out of memory or saturating the CPU or hitting the garbage collection limit this synchronization might be a problem which does not only need to be solved in your code but maybe even requires you to soften some requirements of the high level workflow.

提交回复
热议问题