Re: [DOCS] [GENERAL] full_page_writes = off?

2007-12-10 Thread Greg Smith

On Mon, 10 Dec 2007, Bruce Momjian wrote:


exist for disk controller caches.  Consumer-grade IDE drives are
!particularly likely to have write-back caches that will not survive a
!power failure.  To check write caching on Linux use
!hdparm -I;  it is enabled if there is a * next
!to Write cache.  hdparm -W can to turn off
!write caching.  On FreeBSD use


I'm not where I can submit this as a patch right now, but there are two 
things that should get fixed in the above:


--Saying "Consumer-grade IDE drives" isn't quite right; "Consumer-grade 
IDE and SATA drives" would correctly label the scope of the problem.


--There's a typo on the next to last line here:  "can to turn off".

--
* Greg Smith [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [DOCS] [GENERAL] full_page_writes = off?

2007-12-10 Thread Bruce Momjian

I thought we had the disk write cache control documented for popular
operating systems, but I see we don't so I added the following patch to
our documentation.

---

Greg Smith wrote:
> On Sat, 1 Dec 2007, Tomasz Ostrowski wrote:
> 
> > You can also use "hdparm -I" to check this - look for a "Write
> > caching" in "Commands/features" section. If it has a "*" in front
> > then it is enabled and dangerous.
> 
> Right; using -I works with most Linux hdparm versions:
> 
> # hdparm -V
> hdparm v6.6
> # hdparm -I /dev/hda | grep "Write cache"
> *Write cache
> # hdparm -W 0 /dev/hda
> 
> /dev/hda:
>   setting drive write-caching to 0 (off)
> # hdparm -I /dev/hda | grep "Write cache"
>  Write cache
> 
> While being able to check the state with -W only works in very recent 
> ones.
> 
> The best way to make this change permanent varies depending on your Linux 
> distribution.
> 
> Also:  nowadays many SATA disks appear as SCSI devices like /dev/sda.  In 
> some cases I believe you can use a recent hdparm on them anyway, in others 
> I've had to use sdparm instead.  Several of the examples at 
> http://sg.torque.net/sg/sdparm.html show how to manipulate the Write Cache 
> Enabled (WCE) status similarly to the above on SCSI devices.
> 
> > I don't know how to check it on BSD.
> 
> In FreeBSD I believe you use atacontrol to check the settings, and you can 
> make the changes permanent by fiddling with the /boot/device.hints file.
> 
> --
> * Greg Smith [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD
> 
> ---(end of broadcast)---
> TIP 4: Have you searched our list archives?
> 
>http://archives.postgresql.org/

-- 
  Bruce Momjian  <[EMAIL PROTECTED]>http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/wal.sgml
===
RCS file: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v
retrieving revision 1.46
diff -c -c -r1.46 wal.sgml
*** doc/src/sgml/wal.sgml	28 Nov 2007 15:42:31 -	1.46
--- doc/src/sgml/wal.sgml	10 Dec 2007 14:04:12 -
***
*** 58,65 
 while some are write-back, and the
 same concerns about data loss exist for write-back drive caches as
 exist for disk controller caches.  Consumer-grade IDE drives are
!particularly likely to contain write-back caches that will not
!survive a power failure.

  

--- 58,74 
 while some are write-back, and the
 same concerns about data loss exist for write-back drive caches as
 exist for disk controller caches.  Consumer-grade IDE drives are
!particularly likely to have write-back caches that will not survive a
!power failure.  To check write caching on Linux use
!hdparm -I;  it is enabled if there is a * next
!to Write cache.  hdparm -W can to turn off
!write caching.  On FreeBSD use
!atacontrol.  (For SCSI disks use http://sg.torque.net/sg/sdparm.html";>sdparm
!to turn off WCE.)  On Windows write caching is
!controlled by My Computer\Open\{select disk
!drive}\Properties\Hardware\Properties\Policies\Enable write caching on
!the disk.

  


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [DOCS] [GENERAL] full_page_writes = off?

2007-12-10 Thread Bruce Momjian
Greg Smith wrote:
> On Mon, 10 Dec 2007, Bruce Momjian wrote:
> 
> > exist for disk controller caches.  Consumer-grade IDE drives are
> >!particularly likely to have write-back caches that will not survive a
> >!power failure.  To check write caching on Linux use
> >!hdparm -I;  it is enabled if there is a * next
> >!to Write cache.  hdparm -W can to turn off
> >!write caching.  On FreeBSD use
> 
> I'm not where I can submit this as a patch right now, but there are two 
> things that should get fixed in the above:
> 
> --Saying "Consumer-grade IDE drives" isn't quite right; "Consumer-grade 
> IDE and SATA drives" would correctly label the scope of the problem.
> 
> --There's a typo on the next to last line here:  "can to turn off".

Thanks, both done.
-- 
  Bruce Momjian  <[EMAIL PROTECTED]>http://momjian.us
  EnterpriseDB http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] [ADMIN] Dangerous hint in the PostgreSQL manual

2007-12-10 Thread Joshua D. Drake

Listaccount wrote:

Hello

I have been trapped by the advice from the manual to use "sysctl -w 
vm.overcommit_memory=2" when using Linux (see 16.4.3. Linux Memory 
Overcommit). This value should only be used when PostgreSQL is the only 
Application running on the machine in question. It should be checked 
against the values "CommitLimit" and "Committed_AS" in /proc/meminfo on 
a longer running system. If "Committed_AS" reaches or come close to 
"CommitLimit" one should not set overcommit_memory=2 (see
http://www.redhat.com/archives/rhl-devel-list/2005-February/msg00738.html). 
I think it should be included in the manual as a warning because with 
this setting the machine in question may get trouble with "fork failed" 
even if the standard system tools report a lot of free memory causing 
confusion to the admins.



This discussion belongs on -docs... moving.


Joshua D. Drake



Regards

Andreas



---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match




---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

   http://www.postgresql.org/about/donate