List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:May 7 1999 5:45am
Subject:Re: How fast can a daemon stick a fork() into your ribs?
View as plain text  
In the last episode (May 06), Sasha Pachev said:
> 
> # Linux 2.0.33 www.sashanet.com i586   : Pentium 166 32 MB EDO RAM 
> Static parent/Dynamic child    Avg fork() + execl() time = 8.36 ms
> Static parent/Static child     Avg fork() + execl() time = 1.95 ms
> Dynamic parent/Dynamic child   Avg fork() + execl() time = 8.80 ms
> Dynamic parent/Static child    Avg fork() + execl() time = 2.48 ms
> 
> # Linux 2.0.36 www.isshost.com i686   : Pentium II 350 128 MB SDRAM 
> Static parent/Dynamic child    Avg fork() + execl() time = 2.31 ms
> Static parent/Static child     Avg fork() + execl() time = 0.43 ms
> Dynamic parent/Dynamic child   Avg fork() + execl() time = 2.45 ms
> Dynamic parent/Static child    Avg fork() + execl() time = 0.55 ms

# FreeBSD 4.0-CURRENT micron.danhome.emsphone.com i386   : P/166 32MB EDA RAM
Static parent/Dynamic child     Avg fork() + execl() time = 6.59 ms  v=6.19
Static parent/Static child      Avg fork() + execl() time = 1.41 ms  v=0.96
Dynamic parent/Dynamic child    Avg fork() + execl() time = 7.31 ms  v=6.21
Dynamic parent/Static child     Avg fork() + execl() time = 2.07 ms  v=0.96

# FreeBSD 2.2.8-STABLE emssrv5.emsphone.com i386   : PII/400 128MB SDRAM
Static parent/Dynamic child     Avg fork() + execl() time = 2.38 ms
Static parent/Static child      Avg fork() + execl() time = 0.63 ms
Dynamic parent/Dynamic child    Avg fork() + execl() time = 2.68 ms
Dynamic parent/Static child     Avg fork() + execl() time = 0.87 ms

# SunOS 5.6 pd1.emsphone.com sun4u   : Sparc/400Mhz x6 CPUs, 6gb RAM
Static parent/Dynamic child	Avg fork() + execl() time = 3.14 ms  v=2.94
Static parent/Static child      Avg fork() + execl() time = 0.88 ms  v=0.69
Dynamic parent/Dynamic child    Avg fork() + execl() time = 3.68 ms  v=2.95
Dynamic parent/Static child     Avg fork() + execl() time = 1.41 ms  v=0.65

> I'd be interested to see what you get on others. From the results I
> got, it seems that unless your server(Intel hardware/Linux) gets hit
> in the order of magnitude of 1000 times per second, the overhead of
> fork() + execve() is relatively insignificant. Correct me if my
> interpretation of the results is in error.

Of cource, fork() overhead varies on the size of the process, and is
not the best choice of you're going to do an exec() immediately.  Why
copy your page tables thwn you're going to throw them away in the next
syscall?  The "v" columns are the same program, run with vfork()
instead of fork().

	-Dan Nelson
	dnelson@stripped
Thread
How fast can a daemon stick a fork() into your ribs?Sasha Pachev7 May
  • Re: How fast can a daemon stick a fork() into your ribs?Dan Nelson7 May
  • Re: How fast can a daemon stick a fork() into your ribs?Orlando Andico7 May
  • Re: How fast can a daemon stick a fork() into your ribs?Kevin Ying7 May