Re: apache style squid?

From: Andres Kroonmaa <andre@dont-contact.us>
Date: Tue, 7 Oct 1997 19:45:29 +0200 (EETDST)

--MimeMultipartBoundary
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT

> > forking is VERY bad. LOTS of swap used. Lots of context to switch.
> > Bad news all over.
>
> children. Linux has optimistic memory allocation, Solaris doesn't -- when
> I try the same thing on a Solaris box I have to slap a 2gb disk on it just
> for swap which is never used.

 In theory, if code is linked/loaded into read-only/shared pages, Solaris does
 not reserve swap. Solaris guarantees that writeable page is backed up by
 swap space.
 
> Solaris has a terribly huge context switch overhead, I've never understood
> why. Linux doesn't. For example, I've seen a dual pentium 133 running
> linux do 100 fork()s and exit()s per second, while doing other things. An
> ultra-2 (dual 167s) could almost manage 50 fork()s and exit()s while doing
> nothing else. Those aren't comparable hardware, the ultra box is way
> better than the pentium, ram wasn't an issue. It's not even a comparable

 Small test on my PPro 200 Solaris 2.5.1:

main() {
  int i;
  for (i=0;i < 1000;++i) {
    if ( fork() == 0 ) { exit(0); }
    wait(0);
  }
}

test>truss -c ./a.out
signals ------------
SIGCLD 1000
total: 1000
 
syscall seconds calls errors
_exit .00 1
fork .60 1000
open .00 5 2
close .00 3
wait .33 1000
brk .00 1
lseek .00 2
sysi86 .00 1
execve .00 1
mmap .01 6
fxstat .00 2
sysconfig .00 1
                ---- --- ---
sys totals: .94 2023 2
usr time: .01
elapsed: 4.34

 truss accounts only for parent calls, but just /bin/time shows that all 1000 forks/exits/waits
 are done in 4 secs. This makes roughly 250 forks-exits-waits per second.

> It could be just as simple as cisc vs. risc overhead. But I doubt it.

 I think so. Intel has MMU onchip, whereas RISCs usually has separate units
 that are driven by software. This makes context switches very expensive.

 So, I don't see Solaris overhead is any bigger.

 ----------------------------------------------------------------------
  Andres Kroonmaa mail: andre@online.ee
  Network Manager
  Organization: MicroLink Online Tel: 6308 909
  Tallinn, Sakala 19 Pho: +372 6308 909
  Estonia, EE0001 http://www.online.ee Fax: +372 6308 901
 ----------------------------------------------------------------------

--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:43 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:26 MST