Re: PostgreSQL
[email protected] Thu, 2 Feb 2006 02:54:18 +0100
| Newsgroups | gmane.os.netbsd.devel.performance |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Feb 02, 2006 at 01:19:06AM +0000, [email protected] wrote: > Threads can be created MUCH faster, they take up a lot less memory and they run > in the same address space, which means access to shared data is easy and fast. Come on. How often to do create a thread? Once per connection. How often do you create connections? Don't tell me for each HTTP request, that would be a nice major bottle neck to kill *independent* of the DB(MS) or OS. The amount of memory used by the process vs. thread is neglectable. The whole text segment is shared, most of the global data segment is shared, only the specific context is not. Matter of fact, when counting libc internal data in, threading might not actually save anything at all. Even if you add the overhead of the kernel, most of the state keeps being shared, so almost *nothing* is gained by using a thread. > If PostgreSQL forks a new process for a each connection to a database, it will > be 1) slow, 2) it'll use up all the memory much sooner. ROFL. This is just amusing. Any more wisdom? Joerg