A service io filled, Linux servers not responding limit the maximum number of threads and the current number of threads inquiry

(1). Io server is full, the service is not responding,

sar -q -f / var / log / sa / SA28

 

 The figure above shows plist-sz doubled

plist-sz Description: The number of processes in the list of processes (processes) and number (threads) thread

This algorithm parameters: number + the number of threads in all processes

All number of processes: ps axu | wc -l

Threads: pstree -p | wc -l

Extended:

Linux maximum number of threads and limit the current number of threads inquiry

   

1 summarizes the system has limitations:
    / proc / SYS / Kernel / PID_MAX maximum number of threads supported by the system # check, usually large, equivalent to the theoretical value

    
    /proc/sys/kernel/threads-max

    
    max_user_process # system limits the number of processes or threads can run at up to certain users, use the command: ulimit -u

    

    Note: modify the value max_user_process, you only need to modify /etc/security/limits.conf, but the parameters need to be modified /etc/security/limits.d/90-nproc.conf

    Appendix:
  Appendix 1: centos 6. * can modify /etc/security/limits.d/90-nproc.conf
  my side by modifying /etc/security/limits.conf, at last add
  * Soft nproc 65535
  * Hard nproc 65535

    View default thread stack size, in bytes (Bytes), use the command: ulimit -s

    
    / proc / sys / vm / max_map_count # hardware memory size
    


2, Java virtual machine itself restrictions:
    -Xms #intial the Java heap size
    the -Xmx #maximum the Java heap size
    -Xss the #The the Thread Stack size for the each


3, a program of the current inquiry the number of threads or processes
# pstree -p `ps -e | grep java | awk '{print $ 1}'` | wc -l

The above command is used to replace, on command substitution, that is bracketed by `` command will take precedence, then its output as arguments to other commands
or
# pstree -p process ID | wc -l

# Top -H process ID | wc -l

Used above is a pipe on the pipe: a pipe symbol "|" O command to the left as to the right of command


4, the entire system has been used to query the current thread or process the number of
pstree -p | wc -l

 

Number (2) io-threaded multi-lead to high disk read and write, resulting in service is not responding in a wait state

 sar -d -f / var / log / sa / SA28

 

 

How many number of sectors wr_sec / s write per second

Description:

The total number of transmission I / O per second of: #tps

Total # rd_sec / s per sector read

Total # wr_sec / s per second write sector

# Avgrq-sz times per average disk I / O operation of the data size (sector)

# Avgqu-sz disk requests average queue length

#await complete request from the disk to the operating system processing, the average elapsed time for each request, includes a request queue wait time, in milliseconds (1 second equals 1000 milliseconds), the queue is equal to + seek time + service time

#svctm I / O processing time of service, i.e., not including the time of the request queue

#% Util I / O request CPU percentage occupied by the higher values, indicating slower I / O

 

Guess you like

Origin www.cnblogs.com/wangyh702/p/11608963.html