Home > front end >  More than 1000 times per second, concurrent, how to set up the server?
More than 1000 times per second, concurrent, how to set up the server?

Time:12-06

Ask you a question, I need to do a server, the server processing logic is very simple, data submitted by the software to the client and the server save to calculate md5 key returned to the client,

Problem is the concurrency is bigger, +/1000 seconds, and then the client submitted data is large, at around 300 KB to 800 KB, excuse me everybody, I change how to configure the server, a 50 m enough bandwidth of the server?

CodePudding user response:

Tomcat default configuration the maximum number of requests is 150, that is to say, at the same time support 150 concurrent, of course, can also be of great change,
When an application has more than 250 concurrent, consideration should be given to the application server cluster,
Specific bearing of concurrent, need to see the hardware configuration, the higher the more CPU performance, the more memory allocated to the JVM has the higher performance, but also can increase the burden of GC,
The operating system has certain restrictions on the number of threads in a process:
Windows each process in the threads are not allowed to more than 2000
Linux threads of each process does not allow more than 1000
In addition, every open a thread in Java need cost 1 MB of the JVM memory space used as a thread stack,
The maximum number of concurrent Tomcat can be configured in the practical application, the maximum number of concurrent and hardware performance and CPU number has a lot to do, the better hardware, more processors can make Tomcat support more concurrent,
Tomcat HTTP implementation is to use the default block type Socket communication, each request to create a thread processing, this mode of the concurrency value is limited by the number of threads, but almost no BUG existed for Tomcat,
Tomcat can also configure the NIO way Socket communication, higher than that of blocking type on performance, each request to also do not need to create a thread for processing, concurrent ability is higher than the former, but there is no obstruction of mature,
The concurrent ability is closely related to the application logic, if the logic is need a lot of complicated calculation, the concurrent ability will decline, if each request contains a lot of database operations, so for the performance of the database is also very high,
For a single database server, allowing the client connection number is limited,
Concurrent ability problem involved in the whole system architecture and business logic,
System environment different, Tomcat version is different, the JDK version, and modify different set of parameters, the concurrency value difference is very big,