Test of high concurrency Socket link number under Linux

Source: Internet
Author: User

I. How to increase the service process's Max open files

Ulimit-n can only change the small Max open files, can not be changed large. You need to follow these steps:

    1. Modify the/etc/security/limits.conf file to change 655360 of the rows "soft nofile 655360" and "Hard Nofile 655360" to the desired value
    2. Exit, re-ssh the machine (otherwise invalid)
    3. Modify the startup script for the service by adding "Ulimit-n 950000", where 950000 is the value expected to change
    4. Restart the service process (otherwise invalid), see if it takes effect through "cat/proc/pid/limits", where PID is the service's process ID
    5. The largest max open files allowed by the system can be viewed through "Cat/proc/sys/fs/file-max"

Two. How to modify the TCP port limit for the system

    1. Use "Cat/proc/sys/net/ipv4/ip_local_port_range" to view available ports for system settings
    2. Add "Net.ipv4.ip_local_port_range = 1024 65000" line in/etc/sysctl.conf, execute "sysctl-p", if not error is successful
    3. Use "Cat/proc/sys/net/ipv4/ip_local_port_range" again to see if the available ports for system settings are in effect

Three. Test method

    1. Strengthen the understanding of the test system. For example, the result is undesirable because some limitations on the system are not known to cause a test method error. (Millions of files are not allowed in the same level directory)
    2. Reproduce the problem and try to simulate the user's usage. For example: The coprocessor or physical thread.
    3. Break the assumption: the theoretical judgment will not go to the branch, then there is no test, the number of links is abnormal, it is possible to go to the theoretical judgment will not go to the branch;
    4. Little's Law: pthread_create is not the more threads created, the better, the focus of the test, for this problem, open a few threads, each thread more work can achieve the desired high number of links;
      n = x * E[t], n is the number of your pressure device threads, X is IOPS, e[t] is the average processing time
      Can't press up two reasons 1) n too small 2) e[t] too big
    5. Test the observation. Expect stress to persist in a state, not an instantaneous state, to ensure that the link is no longer available and is not released or released immediately after it is re-connected.
    6. Test performance results, which need to conform to the user's usage. For example: QPS, latency, etc., do not provide users with a performance report that users do not need .
    7. Use tools. For example: can reuse as much as possible, reduce duplication of work. Accumulate more learning tools and less work.

Four. Important things to say three times

    1. Don't forget your original intention
    2. Don't forget your original intention
    3. Don't forget your original intention

User: I want a wagon that runs very fast.

The point is "quick", not "carriage".

Reference:

Maximum number of high concurrent sockets in Linux

Http://soft.chinabyte.com/os/285/12349285.shtml

Test of high concurrency Socket link number under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.