Thread: a few questions

a few questions

From
"surabhi.ahuja"
Date:
 I have a few questions:
1. what is pg_xlog
someone told me that i can move pg_xlog to a different parttion in order to boost the performance? Does it work and how
 
 
2. there is a parameter in postgresql.conf called max_connections. which is 100 be default. i want o decrease it to 20.
by doing this how much can i increase the value of shared buffers?
by default it is 1000, how much can i increase to in order to boost up the performance
 
3. What other things can i do to boost up the performance assuming that the stored procedures are well optimized.
 
4. I recently tried to start postmaster. But it simply timed out. i tried to find out if there is any postmaster process running, but it was not running.
my question is that can u decrease this timeout, right now i think it takes some 1 or 2 minutes...
 
5. i have also seen multiple instances of postmaster.
in my script ot start postmaster i first check if it is running by doing pidof, and only if it is nor running i start it
still have seen multiple instances.
how did that happen? also if i stop postmaster, only one instance is stopped.
 
is there any command to stop all instances of postmaster
 
6. what does ipcclean do? how do i know what shared memory was used by postmaster so that i can clear it, before starting postmaster
 
7. some times if i do a dropdb abc(assuming abc is a database)
it displays a message can not remove directory 12345, although the database is dropped, what shuld be done in such a case?
 
 
thanks,
regards
Surabhi

Re: a few questions

From
Martijn van Oosterhout
Date:
On Thu, Dec 29, 2005 at 03:09:52PM +0530, surabhi.ahuja wrote:
>  I have a few questions:
> 1. what is pg_xlog
> someone told me that i can move pg_xlog to a different parttion in order to boost the performance? Does it work and
how

Yes, it works. How? By moving the directory (while the postmaster is
not running) and creating a symlink in the right place.

> 2. there is a parameter in postgresql.conf called max_connections. which is 100 be default. i want o decrease it to
20.
> by doing this how much can i increase the value of shared buffers?
> by default it is 1000, how much can i increase to in order to boost up the performance

They have nothing to do with eachother. Depending on how much memory
you have, the shared_buffers could be increased by a factor of 10. Max
connections won't change anything there.

> 3. What other things can i do to boost up the performance assuming that the stored procedures are well optimized.

Google the web, or try the pgsql-performence mailing list.

> 4. I recently tried to start postmaster. But it simply timed out. i tried to find out if there is any postmaster
processrunning, but it was not running. 
> my question is that can u decrease this timeout, right now i think it takes some 1 or 2 minutes...

Look in the logs for an error message.

> 5. i have also seen multiple instances of postmaster.
> in my script ot start postmaster i first check if it is running by doing pidof, and only if it is nor running i start
it
> still have seen multiple instances.
> how did that happen? also if i stop postmaster, only one instance is stopped.

Each connection appears as a new process, so pidof wont't work. You
need to use the pidfile the postmaster creates. Why arn't you using one
of the startup scripts provided?

> is there any command to stop all instances of postmaster

Are you sure you have more than one?

> 6. what does ipcclean do? how do i know what shared memory was used by postmaster so that i can clear it, before
startingpostmaster 

PostgreSQL takes care of it's own ipc memory, you should never need to
use ipcclean ever.

> 7. some times if i do a dropdb abc(assuming abc is a database)
> it displays a message can not remove directory 12345, although the database is dropped, what shuld be done in such a
case?

Please provide the exact error message. Oh, and while you're at it,
what platform and what version of postgres. Without that info it's
impossible to give any real help,

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

Re: a few questions

From
Martijn van Oosterhout
Date:
On Thu, Dec 29, 2005 at 03:40:11PM +0530, surabhi.ahuja wrote:
> pidof of doesnt work ?

Given the number of processes is going to be at least 3+number of
connections, how is pidof going to know which one you mean? Answer: it
doesn't, so you end up killing a random one.

> which startup script are u reffering to?

In recent releases they're under contrib/start-scripts but they've been
there for a while. Since you didn't say which version, I can't help you
more than that.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

Re: a few questions

From
Martijn van Oosterhout
Date:
On Fri, Dec 30, 2005 at 06:21:28PM +0530, surabhi.ahuja wrote:
> I am working with PostgerSQL 8.0.0.
> where can i find the startup scripts for the same.

Well, it's been in contrib/strat-scripts since 8.0.0 so you should find
it there.

> One more thing,
> I could not understand this:
> number of processes is going to be at least 3+number of connections
>
> do u mean that for each connection there is a "postmaster" process? and what are those 3 processes?
> actually the ppl who use the application often use kill -9 postmaster. in such a case the pid file still remains.

One postmaster, 2 for the stats collector and possibly 1 for the
autovacuum daemon. Plus one for each connection to the database.

People shouldn't use kill -9 on the postmaster, they should use the
normal signals, or just "pg_ctl stop". Or if you use a startup script,
/etc/init.d/postgresql start/stop.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment