Speed optimization- methods for tuning the performance of LINUX networks :


πŸ¦‘π•ƒπ”Όπ•‹’π•Š π•Šπ•‹π”Έβ„π•‹:

1) Basically, there are three ways to choose.

πŸ’’ Multi-process mode.
πŸ’’ Multi-thread mode.
πŸ’’ Asynchronous mode.

Among them, in the multi-process mode, the server needs to use a process to provide services to a client. Because in the operating system, generating a process requires additional overhead such as process memory copy,

2) So that the performance will be reduced when there are many clients. In order to overcome the extra overhead of this generation process, you can use multi-threaded or asynchronous. In the multi-threaded mode, multiple threads in the process are used to provide services.

3) Due to the lower thread overhead, performance will improve. In fact, there is no need for any additional overhead or asynchronous mode. It uses a non-blocking method to communicate with each client, and the server uses a process for polling.

4) In asynchronous mode, the scheduling of multiple tasks is done by the server program itself, and if a problem occurs in one place, the entire server will have problems, which are not within the scope of the discussion. Increase the number of system threads:

There are many factors that limit the number of threads, mainly the number of processes, the size of memory, the limit of mutex / semaphore / shm / ipc; under normal circumstances, first increase the maximum number of processes, and then expand the memory , In increasing the maximum number of threads, and the method to increase the maximum number of threads is very simple, you only need to change two places in glibc: the maximum number of threads and the size of the thread stack area; the increase in the maximum number of threads is based on the process of asynchronous I / O performance comes at a price; so it needs to be balanced

βœ…Verified

NOTE : For Educational Purpose Only.

@AR4Tech


2 responses to “Speed optimization- methods for tuning the performance of LINUX networks :”

Leave a comment

Design a site like this with WordPress.com
Get started