[CONTENT] System local ports batch occupation

Content One: Occupy system local ports manually

# startport=33000;endport=34000;for i in $(seq $startport $endport);do nc -lk $i &;done

(Add: Take start port is 33000 and end port is 34000 as an example here)

Content Two: Release all ports which are opened manually (kill all nc command processes)

# for i in $(ps -aux | grep nc | grep '\-lk' | awk '{print $2}');do kill $i; done

[CONTENT] Linux maximum number of processes setting

Case One: Set the maximum number of processes for all users

# vim /etc/security/limits.conf

Add the following

......
* soft nofile 10240
* hard nofile 10240

(Add: Take maximum number of processes is 10240 for everyone as an example here)

Case Two: Set the maximum number of processes for one group

# vim /etc/security/limits.conf

Add the following

......
@mingyuzhu soft nofile 10240
@mingyuzhu hard nofile 10240

(Add: Take maximum number of processes is 10240 for group mingyuzhu as an example here)

Case Two: Set the maximum number of processes for one user

# vim /etc/security/limits.conf

Add the following

......
mingyuzhu soft nofile 10240
mingyuzhu hard nofile 10240

(Add: Take maximum number of processes is 10240 for user mingyuzhu as an example here)