Re: Is PostgreSQL as an NT Service the next level? - Mailing list pgsql-cygwin

From Jason Tishler
Subject Re: Is PostgreSQL as an NT Service the next level?
Date
Msg-id 20010805214557.A496@dothill.com
Whole thread Raw
In response to Is PostgreSQL as an NT Service the next level?  ("Robby Slaughter" <webmaster@robbyslaughter.com>)
Responses CYGWIN PostgreSQL problems - backend processes turn non responsive after a a couple hours of hard use.  (Terry Carlin <terry@greatbridge.com>)
List pgsql-cygwin
Robby,

On Wed, Aug 01, 2001 at 04:41:50PM -0500, Robby Slaughter wrote:
> Cygwin folks: It does work---I can execute queries against it and
> am even using some PG/plSQL stored procedures. But it gets slow,
> even with regular vacumming, and more importantly, after a while
> literally dozens of "postgresql.exe" processes appear in the
> Task Manager, bogging down the system until I have to kill all
> the processes and restart the database. This takes about a day
> to happen, with less than 100 inserts over the course of eight
> hours.

Hmm...  The above sounds a little fishy.  I seem to run the regression
tests without any problems and my guess is that it does more than 100
inserts (and other SQL operations) in less that 5 minutes.

Terry Carlin from Great Bridge has been benchmarking PostgreSQL on many
platforms including Cygwin.  Hopefully, he will post his results shortly.

> Granted, I have more tuning to do in my database and there may
> be other bottlenecks between my application and the system. But
> for a production enviroment, do I want to install PostGreSQL
> as an NT Service? I have some documentation about doing the
> same for the ipc-daemon (but it doesn't seem to work).
>
> Right now, I have two batch files in the Startup folder which
> call the IPC daemon, delete any .pid files, and start up the
> postmaster. But this leaves windows all over the screen and
> I am wondering---maybe other inefficencies?
>
> So my question is two fold. 1) Is moving to NT services a
> good idea and 2) Where can I learn more about setting this stuff
> up?

I run both ipc-daemon and postmaster as NT services.  ipc-daemon can be
installed as follows:

    $ ipc-daemon --install-as-service

and postmaster as follows:

    $ cygrunsrv --install postmaster --path /usr/bin/postmaster --args "-D /usr/share/postgresql/data -i" --dep
ipc-daemon--termsig INT --user postgres --shutdown 

Note the following:

1. To get proper postmaster shutdown semantics (i.e., automatic deletion
of postmaster.pid) then you will need to use a Cygwin snapshot from 7/28/01
or later.
2. I have only tested this when running ipc-daemon under the LocalSystem
account and postmaster under my account (i.e., jt) which is also a member
of the local administrators group.  YMMV with another account such as
postgres (i.e., a non-privileged account).

See the following:

    http://www.neuro.gatech.edu/users/cwilson/cygutils/V1.1/cygipc/
    /usr/doc/Cygwin/cygrunsrv.README

for more information on cygipc and cygrunsrv respectively.

Jason

--
Jason Tishler
Director, Software Engineering       Phone: 732.264.8770 x235
Dot Hill Systems Corp.               Fax:   732.264.8798
82 Bethany Road, Suite 7             Email: jason@tishler.net
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

pgsql-cygwin by date:

Previous
From: Erwin van den Berg
Date:
Subject: TCP-IP outside Cygwin?
Next
From: Erwin van den Berg
Date:
Subject: Compiling problems