Solution for Does page-fault effect performance much, by forking child process?
is Given Below:
I have a busy process which occupies 30% CPU and 1G memory usage, at Linux.
The process makes a snapshot every hour, by calling
fork() to create a child process which writes all data to a file. It takes about 1second.
I found that the father process’s CPU usage becomes about 60% during the snapshot.
I guess the reason may be: forking a child makes most memory as Copy-on-write, and child process just reads memory so it does not trigger page-fault to copy pages, while the father process triggers many page-fault which results to a higher CPU usage.
Am I right? Can page-fault effects performance so much?
== add stats ==
I count the page-fault by
ps -o min_flt, and there are ~7k page-faults per second. Is it effects performance much?