Originally posted by YohanN7
You are clearly a genius!
Oh, how I wish...
However I have learned to listen to my random thoughts.
It is amazing how many times something "popped up" like that when I was totally thinking of something else.
Glad it worked ♠_biggrin:
(But I'm still wondering out of curiosity, how do I get rid of 4-5 of the remaining 6 idle agents? But this can surely wait til a rainy day :))
I don't think that they are idle. According to one of the FAQs, there are internal processes that get their own process.
In MS SQLSever, for example, if you look at the management tools, you can see several processes, but there is only one OS-level process. If you examine that process w/ process_explorer (a 3rd party tool unfortunately) you can see that there are several hundred threads.
So for postgres, I would imagine it looks something like:
♦ master process that governs service details
♦ master/system database
♦ "template" database
♦ Task scheduler for things like auto-vacuum
♦ Client manager / Error handler / logger / transaction manager
♦ Language Handler (you can install procedural languages)
Well after I typed all that I found this:
http://www.postgresql.org/docs/8.4/static/connect-estab.html
The pertinent paragraph:
PostgreSQL is implemented using a simple "process per user" client/server model. In this model there is one client process connected to exactly one server process. As we do not know ahead of time how many connections will be made, we have to use a master process that spawns a new server process every time a connection is requested. This master process is called postgres and listens at a specified TCP/IP port for incoming connections. Whenever a request for a connection is detected the postgres process spawns a new server process. The server tasks communicate with each other using semaphores and shared memory to ensure data integrity throughout concurrent data access.
I think I remember you mentioned that you did C programming, so I think you'll understand that.
So I was wrong in my guess, but not TOO far off.
All-in-all, I'm glad you raised the question, because I got a lot further in my understanding of postgres that I did the last time I went digging.
The bit about sharing memory is interesting. What it means is that the total memory occupied by ALL processes is probably less than the total reported by Task Manager.
I don't think that I've ever written a program that shared memory, but everything I ever wrote was intended to work standalone.
Cheers,
--VS