Re: FW: Postgres alongside MS SQL Server

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Lincoln Yeoh" <lyeoh(at)pop(dot)jaring(dot)my>, "Anony Mous" <A(dot)Mous(at)shaw(dot)ca>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: FW: Postgres alongside MS SQL Server
Date: 2004-04-23 16:13:24
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE17165B@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> >How is it possible for Postgresql to "freak out" and take out the
> >machine?
>
> How easy/likely is it for a program run as a normal user to
> blue screen an MS server?
> How easy/likely is it for a program run as a normal user to
> do the equiv to
> a FreeBSD/Linux server?

With *decent drivers* this should be about as hard (in theory impossible
on both, but we all know that's not true). Now there are a lot of
drivers that let this happen quite easily. Especially graphics drivers.
So stay away from any high performance graphics drivers on the server.

An important thing to notice here is that you should *NEVER EVER* run
the database server as "Local System". This account has way too many
rights and permissions. Including modifying some things in kernel level.
Always use a specific account for the server (try to stay away from
making this account a "local administrator", but even if you have to do
that it is miles better than Local System)

> I'm not sure if it is easy to limit Postgresql memory usage
> "gracefully" on
> an MS box. AFAIK you can do memory limits on Linux/Unix boxes.

There are ways using what's called a "Job Object". You'll need a
frontend for it, though (it's just API calls). And IIRC MS ships a
frontend for it only on Datacenter Server. But there are third-party
tools available, or you can write yuor own wrapper if you're comfy
enough with that (look at CreateJobObject(), SetInformationJobObject()
and AssignProcessToJobObject() APIs on MSDN)
Doing this, malloc() and friends will return "out of memory".

> MS built-in task manager doesn't let you kill all processes.

It will let you kill any processes at your own level of permissions,
just as Unix will. The difference is that a local admin on the machine
is not equal to root, and can still not kill processes owned by "Local
System".

As a tip, a way to kill a local system process is to use "at
/interactive" to schedule a "pviewer.exe" fromt he support tools
(they're on the CD, but not installed by default). Then pviewer.exe will
run as local system. From that one, you can kill local system processes.

> You need 3rd
> party tools to do the equiv of kill -9. But of course you
> shouldn't kill -9
> postgresql. Which brings us to something I don't know the answer of -
> what's the safe way of terminating postgresql on a MS server?

I don't know enough about the cygwin version to comment on that one, but
for the upcoming native version there will be:
* If running as a service, use service control manager
* If running in a console window, use Ctrl-C in that window
* In either case, use the "pgkill" tool (currently on the win32 status
page, not sure what to do about that when we get to release time. If
it's to be included, it has to be cleaned up)
* Possibly a pg_terminate_backend() function inside a pqsl session

//Magnus

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2004-04-23 16:42:09 Re: FW: Postgres alongside MS SQL Server
Previous Message Pascal Polleunus 2004-04-23 15:18:29 Re: Synchronize unicode data using copy or pg_dump