Philosophically speaking, eliminating bottlenecks is the only way to improve server performance and concurrency capabilities.
If you can eliminate all bottlenecks, you will be able to maximize the performance of the hardware, so that the performance and concurrency of the system to reach the best.
Use multi-threaded multicore programming, using event-driven or asynchronous messaging mechanisms to minimize blocking and waiting operations (such as I/O blocking, synchronous wait, or timing/timeouts, etc.).
Principle:
1. Multithreading multi-core programming, eliminate CPU bottleneck.
2, using IOCP or Epoll, the use of State monitoring and notification methods to eliminate network I/O blocking bottlenecks.
3, the use of event-driven or asynchronous message mechanism, you can eliminate unnecessary wait operations.
4. In the case of Linux, AIO can be used to eliminate disk I/O blocking bottlenecks.
5. The timer event is handled uniformly in the event-driven framework or asynchronous message, and the synchronization is asynchronous, and countless timer events can be handled in one thread.
6, in-depth analysis of external blocking sources, eliminate it.
For example, the database query is slow, cause the server processing is slow, the number of concurrent does not go, this is the optimization of database performance.
7, if the traffic with some other server is very large, resulting in more performance degradation.
Consider putting the two servers on a single host, using shared memory to do IPC communication, which can greatly improve performance.
Improve server performance and concurrency