We often need to check the number of httpd processes for optimization (that is, the number of concurrent requests that Apache can process in prefork mode ):
Linux Command:
PS-Ef | grep httpd | WC-l
The result is the number of concurrent requests that Apache can process. This value is automatically adjusted based on the load.
# Ps-Ef | grep httpd | WC-l
27
PS-EF is to view all processes, and then filter the process information you want through grep
Parameter description:-e displays all processes in the full-F format.
# Ps-Ef | grep httpd
Parameter description: Check all httpd processes.
# Ps-Ef | grep httpd | WC-l
Parameter description: Check all httpd processes and output only the number of file lines through WC-L.
WC command
WC-C filename: displays the number of bytes of a file.
WC-M filename: display the number of characters in a file
WC-l filename: display the number of lines in a file
WC-l filename: display the maximum length of a file
WC-W filename: display the number of words in a file
run wc wc1.txt directly:
[ROC [email protected] programming] $ WC wc1.txt
3 5 16 wc1.txt
the output information is as follows: number of lines, number of characters, and number of bytes.