Igor Kovalenko wrote:
> I think SGI gets amazing performance because they have very good (efficient)
> synchronization primitives on SGI. Some proprietary light-weight mutexes.
> Using threaded or mixed model just by itself is not going to do a miracle.
> Threads will save you some context switch time, but that will probably
> translate into lower CPU usage rather than performance boost. And if your
> mutexes are not fast or awkwardly implemented (say Linux), it might be even
> worse. Apache is not all that fast on Linux as on SGI, whatever model you
> chose. I also doubt that purely threaded model would be slower than mixed
> one.
Let me throw out an idea. I have been mentioning full fork, light
fork(copy globals only), and threading as possible solutions.
Another idea uses neither threading nor copying. It is the old system
we used before I removed exec() from our code. We used to pass the
database name as an argument to an exec'ed postgres binary that
continued with the database connection.
We removed the exec, then started moving what we could into the
postmaster so each backend didn't need to do the initialization.
One solution is to return to that for Win32 only, so instead of doing:
initialization()want for connection()fork backend()
we do for Win32:
want for connection()exec backend()initialization()
It wouldn't be hard to do. We would still do CreateProcess rather than
CreateThread, but it eliminates the fork/threading issues. We don't
know the database before the connection arrives, so we don't do a whole
lot of initialization.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026