I have a production server that is showing a very large number of forks when running vmstat -f
. Any suggestions on steps that could be used to help find out what the origin of the forks are?
vmstat -f 1
6650796 forks
EDIT:
[~]$ ./forks.sh
Forks in last 2 seconds: 20
Forks in last 2 seconds: 40
Forks in last 2 seconds: 58
Forks in last 2 seconds: 9
Forks in last 2 seconds: 6
Forks in last 2 seconds: 28
Forks in last 2 seconds: 8
Forks in last 2 seconds: 10
Forks in last 2 seconds: 15
Forks in last 2 seconds: 9
Best Answer
According to the man page, it includes all calls to fork, vfork or clone. The last one of these three (clone) is used by Java to implement its threads
So each time your Java server creates a new thread, that value increments.
Providing it doesn't go silly, it should be fine. How many per second do you see on average?