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:
- Modify the/etc/security/limits.conf file to change 655360 of the rows "soft nofile 655360" and "Hard Nofile 655360" to the desired value
- Exit, re-ssh the machine (otherwise invalid)
- Modify the startup script for the service by adding "Ulimit-n 950000", where 950000 is the value expected to change
- Restart the service process (otherwise invalid), see if it takes effect through "cat/proc/pid/limits", where PID is the service's process ID
- 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
- Use "Cat/proc/sys/net/ipv4/ip_local_port_range" to view available ports for system settings
- Add "Net.ipv4.ip_local_port_range = 1024 65000" line in/etc/sysctl.conf, execute "sysctl-p", if not error is successful
- 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
- 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)
- Reproduce the problem and try to simulate the user's usage. For example: The coprocessor or physical thread.
- 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;
- 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
- 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.
- 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 .
- 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
- Don't forget your original intention
- Don't forget your original intention
- 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