Subject Re: [IB-Architect] Re : License Question
Author Andi Kleen
On Thu, Mar 23, 2000 at 12:18:23PM +1000, Ryan Mills wrote:
> > > is extra overhead associated with starting a new process for
> > > each connection. If you were in an environment where you were
> > > getting lots of separate connections at the same time this
> > > would cause a performance problem.
> >
> > On a modern Unix fork()/exec() has been heavily optimized. The "fork
> > is insanely slow" rule of thumb dating from Unix prehistory is often not
> > true anymore. On Linux a fork() is really cheap, and the exec can be tuned
> > with minor tricks like statically linking the application.
>
> While cheap, its still slow compared to threading the process and using
> mutexes to access shared memory. Look at MySQL and how quick it runs along
> using threading. The issue isn't so much if a fork() is really cheap or
> not, its more so the memory constructions each time you create an instance.

I doubt the reason of Mysql's speed is the threading. Although it is
moot because the work is already done in Interbase/SuperServer often
you have a hard time to justify the amount of work needed to redesign
all the data structures in a complex application for the locking in
multithreaded applications. The fact that Classic scales better on SMP
than SuperServer shows that the work is not complete BTW, you can
sink near endless work into suitable locking. The question is if it is a
good use of resources.

>
> > Preforking and reusing existing processes like Apache does
> > offers some speed up, but probably not as much as you may imagine. I
> > guess it will be only really beneficial if Interbase has a lot of
> > startup overhead per process (I'm not sure if it does, but please
> > profile before design). On NT threads are needed, because process creation
> > is insanely slow there.
>
> Apache is apache. At the end of the day mutilthreading one server will beat
> it hands down.

At least on Linux that is not necessarily true. Apache 1.3 + SGI speedup
patches (which do not change the fork(), but mainly change stuff like
adding a header cache) is one of the fastest web servers
for bulk traffic.


-Andi