pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Swapping on Solaris
22+ messages / 10 participants
[nested] [flat]

* Swapping on Solaris
@ 2005-01-18 22:49 Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  0 siblings, 1 reply; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-18 22:49 UTC (permalink / raw)
  To: pgsql-performance

Hello,
    I'm running PostgreSQL on a Solaris 8 system with 2GB of RAM and I'm 
having some difficulty getting PostgreSQL to use the available RAM.  My RAM 
settings in postgresql.conf are

shared_buffers = 8192   # min 16, at least max_connections*2, 8KB each
sort_mem = 131072               # min 64, size in KB
vacuum_mem = 131072             # min 1024, size in KB

Ignoring the fact that the sort and vacuum numbers are really high, this is 
what Solaris shows me when running top:

Memory: 2048M real, 1376M free, 491M swap in use, 2955M swap free

For some reason I have 1.25GB of free RAM but PostgreSQL seems compelled to 
swap to the hard drive rather than use that RAM.  I have the shared buffers 
set as high as the Solaris kernel will let me.  I also know that Solaris 
will cache frequently used files in RAM, thereby lowering the amount of RAM 
available to an application, but my understanding is that Solaris will dump 
that cache if an application or the kernel itself requires it.

    The system has about 1,000 active email users using unix mailboxes which 
could what is keeping the database from exploiting as much RAM as available 
but my primary concern is to allow PostgreSQL to use as much RAM as it 
requires without swapping.

    What can I do to force the system to allow PostgreSQL to do this?

Regards,
Kevin Schroeder 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 07:40 ` Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  0 siblings, 2 replies; 22+ messages in thread

From: Mark Kirkwood @ 2005-01-19 07:40 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance

Kevin Schroeder wrote:
>
> 
> Ignoring the fact that the sort and vacuum numbers are really high, this 
> is what Solaris shows me when running top:
> 
> Memory: 2048M real, 1376M free, 491M swap in use, 2955M swap free
> 
Maybe check the swap usage with 'swap -l' which reports reliably if any
(device or file) swap is actually used.

I think Solaris 'top' does some strange accounting to calculate the
'swap in use' value (like including used memory).

It looks to me like you are using no (device or file) swap at all, and
have 1.3G of real memory free, so could in fact give Postgres more of it :-)

regards

Mark




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
@ 2005-01-19 09:57   ` Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 14:52     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 14:57     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  1 sibling, 2 replies; 22+ messages in thread

From: Matt Casters @ 2005-01-19 09:57 UTC (permalink / raw)
  To: pgsql-performance


> Kevin Schroeder wrote:
> It looks to me like you are using no (device or file) swap at all, and
> have 1.3G of real memory free, so could in fact give Postgres more of it :-)
>

Indeed.
If you DO run into trouble after giving Postgres more RAM, use the vmstat command.
You can use this command like "vmstat 10". (ignore the first line)
Keep an eye on the "pi" and "po" parameters. (kilobytes paged in and out)

HTH,

Matt
------
Matt Casters <matt.casters@ibridge.be>
i-Bridge bvba, http://www.kettle.be
Fonteinstraat 70, 9400 Okegem, Belgium
Phone +32 (0) 486/97.29.37




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
@ 2005-01-19 14:52     ` Kevin Schroeder <kschroeder@mirageworks.com>
  1 sibling, 0 replies; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 14:52 UTC (permalink / raw)
  To: pgsql-performance

po and pi are relatively low, but do pick up when there's an increase in 
activity.  I am seeing a lot of "minor faults", though.  vmstat -S 5 reports

 [9:38am]# vmstat -S 5
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  si  so pi po fr de sr s0 s1 s3 --   in   sy   cs us sy 
id
 0 0 0 3235616 1414536 0  0 303 11 10 0  0  6 24  0  0   13  192  461 17 11 
72
 1 0 0 3004376 1274912 0  0  0  0  0  0  0  3 16  0  0  494 1147  441 52 25 
23

494 in faults
1147 sy faults

Generally faults are a bad thing.  Is that the case here?

Kevin

----- Original Message ----- 
From: "Matt Casters" <Matt.Casters@advalvas.be>
To: <pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 3:57 AM
Subject: Re: [PERFORM] Swapping on Solaris



> Kevin Schroeder wrote:
> It looks to me like you are using no (device or file) swap at all, and
> have 1.3G of real memory free, so could in fact give Postgres more of it 
> :-)
>

Indeed.
If you DO run into trouble after giving Postgres more RAM, use the vmstat 
command.
You can use this command like "vmstat 10". (ignore the first line)
Keep an eye on the "pi" and "po" parameters. (kilobytes paged in and out)

HTH,

Matt
------
Matt Casters <matt.casters@ibridge.be>
i-Bridge bvba, http://www.kettle.be
Fonteinstraat 70, 9400 Okegem, Belgium
Phone +32 (0) 486/97.29.37


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)






^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
@ 2005-01-19 14:57     ` Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:42       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  1 sibling, 1 reply; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 14:57 UTC (permalink / raw)
  To: pgsql-performance

I take that back.  There actually is some paging going on.  I ran sar -g 5 
10 and when a request was made (totally about 10 DB queries) my pgout/s 
jumped to 5.8 and my ppgout/s jumped to 121.8.  pgfree/s also jumped to 
121.80.

Kevin

----- Original Message ----- 
From: "Matt Casters" <Matt.Casters@advalvas.be>
To: <pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 3:57 AM
Subject: Re: [PERFORM] Swapping on Solaris



> Kevin Schroeder wrote:
> It looks to me like you are using no (device or file) swap at all, and
> have 1.3G of real memory free, so could in fact give Postgres more of it 
> :-)
>

Indeed.
If you DO run into trouble after giving Postgres more RAM, use the vmstat 
command.
You can use this command like "vmstat 10". (ignore the first line)
Keep an eye on the "pi" and "po" parameters. (kilobytes paged in and out)

HTH,

Matt
------
Matt Casters <matt.casters@ibridge.be>
i-Bridge bvba, http://www.kettle.be
Fonteinstraat 70, 9400 Okegem, Belgium
Phone +32 (0) 486/97.29.37


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)






^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 14:57     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 15:42       ` Alan Stange <stange@rentec.com>
  2005-01-19 15:53         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 16:58         ` Re: Swapping on Solaris Jeff <threshar@torgo.978.org>
  2005-01-27 21:36         ` Re: Swapping on Solaris Andrew Sullivan <ajs@crankycanuck.ca>
  0 siblings, 3 replies; 22+ messages in thread

From: Alan Stange @ 2005-01-19 15:42 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance

Kevin Schroeder wrote:

> I take that back.  There actually is some paging going on.  I ran sar 
> -g 5 10 and when a request was made (totally about 10 DB queries) my 
> pgout/s jumped to 5.8 and my ppgout/s jumped to 121.8.  pgfree/s also 
> jumped to 121.80.

I'm fairly sure that the pi and po numbers include file IO in Solaris, 
because of the unified VM and file systems.

-- Alan



^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 14:57     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:42       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-19 15:53         ` Kevin Schroeder <kschroeder@mirageworks.com>
  2 siblings, 0 replies; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 15:53 UTC (permalink / raw)
  To: ; +Cc: pgsql-performance

Maybe, I'm just seeing a problem where none exists.  I ran sar -w 3 100 and 
I actually did not see any swap activity despite the fact that I've got 
500+MB of swap file being used.

Kevin

----- Original Message ----- 
From: "Alan Stange" <stange@rentec.com>
To: "Kevin Schroeder" <kschroeder@mirageworks.com>
Cc: <pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 9:42 AM
Subject: Re: [PERFORM] Swapping on Solaris


> Kevin Schroeder wrote:
>
>> I take that back.  There actually is some paging going on.  I ran sar -g 
>> 5 10 and when a request was made (totally about 10 DB queries) my pgout/s 
>> jumped to 5.8 and my ppgout/s jumped to 121.8.  pgfree/s also jumped to 
>> 121.80.
>
> I'm fairly sure that the pi and po numbers include file IO in Solaris, 
> because of the unified VM and file systems.
>
> -- Alan
>
>
> 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 14:57     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:42       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-19 16:58         ` Jeff <threshar@torgo.978.org>
  2 siblings, 0 replies; 22+ messages in thread

From: Jeff @ 2005-01-19 16:58 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance


On Jan 19, 2005, at 10:42 AM, Alan Stange wrote:

> Kevin Schroeder wrote:
>
>> I take that back.  There actually is some paging going on.  I ran sar 
>> -g 5 10 and when a request was made (totally about 10 DB queries) my 
>> pgout/s jumped to 5.8 and my ppgout/s jumped to 121.8.  pgfree/s also 
>> jumped to 121.80.
>
> I'm fairly sure that the pi and po numbers include file IO in Solaris, 
> because of the unified VM and file systems.

Curiously, what are your shared_buffers and sort_mem set too?
Perhaps they are too high?


--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 14:57     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:42       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-27 21:36         ` Andrew Sullivan <ajs@crankycanuck.ca>
  2005-02-02 15:54           ` Re: Swapping on Solaris Bruce Momjian <pgman@candle.pha.pa.us>
  2 siblings, 1 reply; 22+ messages in thread

From: Andrew Sullivan @ 2005-01-27 21:36 UTC (permalink / raw)
  To: pgsql-performance

On Wed, Jan 19, 2005 at 10:42:26AM -0500, Alan Stange wrote:
> 
> I'm fairly sure that the pi and po numbers include file IO in Solaris, 
> because of the unified VM and file systems.

That's correct.

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
When my information changes, I alter my conclusions.  What do you do sir?
		--attr. John Maynard Keynes



^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 09:57   ` Re: Swapping on Solaris Matt Casters <Matt.Casters@advalvas.be>
  2005-01-19 14:57     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:42       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-27 21:36         ` Re: Swapping on Solaris Andrew Sullivan <ajs@crankycanuck.ca>
@ 2005-02-02 15:54           ` Bruce Momjian <pgman@candle.pha.pa.us>
  0 siblings, 0 replies; 22+ messages in thread

From: Bruce Momjian @ 2005-02-02 15:54 UTC (permalink / raw)
  To: Andrew Sullivan <ajs@crankycanuck.ca>; +Cc: pgsql-performance

Andrew Sullivan wrote:
> On Wed, Jan 19, 2005 at 10:42:26AM -0500, Alan Stange wrote:
> > 
> > I'm fairly sure that the pi and po numbers include file IO in Solaris, 
> > because of the unified VM and file systems.
> 
> That's correct.

I have seen cases on BSDs where 'pi' includes page-faulting in the
executables from the file system, but Solaris actually has 'po' as
filesystem I/O.  That is a new one to me.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
@ 2005-01-19 13:51   ` Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:07     ` Re: Swapping on Solaris Greg Spiegelberg <gspiegelberg@cranel.com>
  1 sibling, 2 replies; 22+ messages in thread

From: Alan Stange @ 2005-01-19 13:51 UTC (permalink / raw)
  To: ; +Cc: Kevin Schroeder <kschroeder@mirageworks.com>; pgsql-performance

Mark Kirkwood wrote:

> Kevin Schroeder wrote:
>
>>
>>
>> Ignoring the fact that the sort and vacuum numbers are really high, 
>> this is what Solaris shows me when running top:
>>
>> Memory: 2048M real, 1376M free, 491M swap in use, 2955M swap free
>>
> Maybe check the swap usage with 'swap -l' which reports reliably if any
> (device or file) swap is actually used.
>
> I think Solaris 'top' does some strange accounting to calculate the
> 'swap in use' value (like including used memory).
>
> It looks to me like you are using no (device or file) swap at all, and
> have 1.3G of real memory free, so could in fact give Postgres more of 
> it :-)

I suspect that "free" memory is in fact being used for the file system 
cache.   There were some changes in the meaning of "free" in Solaris 8 
and 9.   The memstat command gives a nice picture of memory usage on the 
system.   I don't think memstat came with Solaris 8, but you can get it 
from solarisinternals.com.   The Solaris Internals book is an excellent 
read as well; it explains all of this in gory detail. 

Note that files in /tmp are usually in a tmpfs file system.   These 
files may be the usage of swap that you're seeing (as they will be paged 
out on an active system with some memory pressure)

Finally, just as everyone suggests upgrading to newer postgresql 
releases, you probably want to get to a newer Solaris release. 

-- Alan



^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-19 14:31     ` Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  1 sibling, 1 reply; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 14:31 UTC (permalink / raw)
  To: ; +Cc: pgsql-performance

I suspect that the memory is being used to cache files as well since the 
email boxes are using unix mailboxes, for the time being.  With people 
checking their email sometimes once per minute I can see why Solaris would 
want to cache those files.  Perhaps my question would be more appropriate to 
a Solaris mailing list since what I really want to do is get Solaris to 
simply allow PostgreSQL to use more RAM and reduce the amount of RAM used 
for file caching.  I would have thought that Solaris gives some deference to 
a running application that's being swapped than for a file cache.

Is there any way to set custom parameters on Solaris' file-caching behavior 
to allow PostgreSQL to use more physical RAM?

I will also check out memstat.  It's not on my system, but I'll get it from 
the site you noted.

Thanks
Kevin


----- Original Message ----- 
From: "Alan Stange" <stange@rentec.com>
Cc: "Kevin Schroeder" <kschroeder@mirageworks.com>; 
<pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 7:51 AM
Subject: Re: [PERFORM] Swapping on Solaris


> Mark Kirkwood wrote:
>
>> Kevin Schroeder wrote:
>>
>>>
>>>
>>> Ignoring the fact that the sort and vacuum numbers are really high, this 
>>> is what Solaris shows me when running top:
>>>
>>> Memory: 2048M real, 1376M free, 491M swap in use, 2955M swap free
>>>
>> Maybe check the swap usage with 'swap -l' which reports reliably if any
>> (device or file) swap is actually used.
>>
>> I think Solaris 'top' does some strange accounting to calculate the
>> 'swap in use' value (like including used memory).
>>
>> It looks to me like you are using no (device or file) swap at all, and
>> have 1.3G of real memory free, so could in fact give Postgres more of it 
>> :-)
>
> I suspect that "free" memory is in fact being used for the file system 
> cache.   There were some changes in the meaning of "free" in Solaris 8 and 
> 9.   The memstat command gives a nice picture of memory usage on the 
> system.   I don't think memstat came with Solaris 8, but you can get it 
> from solarisinternals.com.   The Solaris Internals book is an excellent 
> read as well; it explains all of this in gory detail.
> Note that files in /tmp are usually in a tmpfs file system.   These files 
> may be the usage of swap that you're seeing (as they will be paged out on 
> an active system with some memory pressure)
>
> Finally, just as everyone suggests upgrading to newer postgresql releases, 
> you probably want to get to a newer Solaris release.
> -- Alan
>
>
> 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 15:30       ` Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  0 siblings, 1 reply; 22+ messages in thread

From: Alan Stange @ 2005-01-19 15:30 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance

Kevin Schroeder wrote:

> I suspect that the memory is being used to cache files as well since 
> the email boxes are using unix mailboxes, for the time being.  With 
> people checking their email sometimes once per minute I can see why 
> Solaris would want to cache those files.  Perhaps my question would be 
> more appropriate to a Solaris mailing list since what I really want to 
> do is get Solaris to simply allow PostgreSQL to use more RAM and 
> reduce the amount of RAM used for file caching.  I would have thought 
> that Solaris gives some deference to a running application that's 
> being swapped than for a file cache.
>
> Is there any way to set custom parameters on Solaris' file-caching 
> behavior to allow PostgreSQL to use more physical RAM?

Your explanation doesn't sound quite correct.   If postgresql malloc()'s 
some memory and uses it, the file cache will be reduced in size and the 
memory given to postgresql.   But if postgresql doesn't ask for or use 
the memory, then solaris is going to use it for something else.  There's 
nothing in Solaris that doesn't "allow" postgresql to use more RAM.

-- Alan



^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-19 15:40         ` Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 17:04           ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 17:36           ` Re: Swapping on Solaris Jeff <threshar@torgo.978.org>
  2005-01-19 23:47           ` Re: Swapping on Solaris Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 3 replies; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 15:40 UTC (permalink / raw)
  To: ; +Cc: pgsql-performance

I may be asking the question the wrong way, but when I start up PostgreSQL 
swap is what gets used the most of.  I've got 1282MB free RAM right now and 
and 515MB swap in use.  Granted, swap file usage probably wouldn't be zero, 
but I would guess that it should be a lot lower so something must be keeping 
PostgreSQL from using the free RAM that my system is reporting.  For 
example, one of my postgres processes is 201M in size but on 72M is resident 
in RAM.  That extra 130M is available in RAM, according to top, but postgres 
isn't using it.

Kevin

----- Original Message ----- 
From: "Alan Stange" <stange@rentec.com>
To: "Kevin Schroeder" <kschroeder@mirageworks.com>
Cc: <pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 9:30 AM
Subject: Re: [PERFORM] Swapping on Solaris


> Kevin Schroeder wrote:
>
>> I suspect that the memory is being used to cache files as well since the 
>> email boxes are using unix mailboxes, for the time being.  With people 
>> checking their email sometimes once per minute I can see why Solaris 
>> would want to cache those files.  Perhaps my question would be more 
>> appropriate to a Solaris mailing list since what I really want to do is 
>> get Solaris to simply allow PostgreSQL to use more RAM and reduce the 
>> amount of RAM used for file caching.  I would have thought that Solaris 
>> gives some deference to a running application that's being swapped than 
>> for a file cache.
>>
>> Is there any way to set custom parameters on Solaris' file-caching 
>> behavior to allow PostgreSQL to use more physical RAM?
>
> Your explanation doesn't sound quite correct.   If postgresql malloc()'s 
> some memory and uses it, the file cache will be reduced in size and the 
> memory given to postgresql.   But if postgresql doesn't ask for or use the 
> memory, then solaris is going to use it for something else.  There's 
> nothing in Solaris that doesn't "allow" postgresql to use more RAM.
>
> -- Alan
>
>
> 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 17:04           ` Alan Stange <stange@rentec.com>
  2005-01-19 17:08             ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2 siblings, 1 reply; 22+ messages in thread

From: Alan Stange @ 2005-01-19 17:04 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance

Kevin Schroeder wrote:

> I may be asking the question the wrong way, but when I start up 
> PostgreSQL swap is what gets used the most of.  I've got 1282MB free 
> RAM right now and and 515MB swap in use.  Granted, swap file usage 
> probably wouldn't be zero, but I would guess that it should be a lot 
> lower so something must be keeping PostgreSQL from using the free RAM 
> that my system is reporting.  For example, one of my postgres 
> processes is 201M in size but on 72M is resident in RAM.  That extra 
> 130M is available in RAM, according to top, but postgres isn't using it. 

The test you're doing doesn't measure what you think you're measuring.

First, what else is running on the machine?    Note that some shared 
memory allocations do reserve backing pages in swap, even though the 
pages aren't currently in use.  Perhaps this is what you're measuring?  
"swap -s" has better numbers than top.

You'd be better by trying a reboot then starting pgsql and seeing what 
memory is used.

Just because you start a process and see the swap number increase 
doesn't mean that the new process is in swap.  It means some anonymous 
pages had to be evicted to swap to make room for the new process or some 
pages had to be reserved in swap for future use.   Typically a new 
process won't be paged out unless something else is causing enormous 
memory pressure...

-- Alan



^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 17:04           ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-19 17:08             ` Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 19:01               ` Re: Swapping on Solaris Matt Clark <matt@ymogen.net>
  0 siblings, 1 reply; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 17:08 UTC (permalink / raw)
  To: ; +Cc: pgsql-performance

I think it's probably just reserving them.  I can't think of anything else. 
Also, when I run swap activity with sar I don't see any activity, which also 
points to reserved swap space, not used swap space.

swap -s reports

total: 358336k bytes allocated + 181144k reserved = 539480k used, 2988840k 
available

Kevin

----- Original Message ----- 
From: "Alan Stange" <stange@rentec.com>
To: "Kevin Schroeder" <kschroeder@mirageworks.com>
Cc: <pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 11:04 AM
Subject: Re: [PERFORM] Swapping on Solaris


> Kevin Schroeder wrote:
>
>> I may be asking the question the wrong way, but when I start up 
>> PostgreSQL swap is what gets used the most of.  I've got 1282MB free RAM 
>> right now and and 515MB swap in use.  Granted, swap file usage probably 
>> wouldn't be zero, but I would guess that it should be a lot lower so 
>> something must be keeping PostgreSQL from using the free RAM that my 
>> system is reporting.  For example, one of my postgres processes is 201M 
>> in size but on 72M is resident in RAM.  That extra 130M is available in 
>> RAM, according to top, but postgres isn't using it.
>
> The test you're doing doesn't measure what you think you're measuring.
>
> First, what else is running on the machine?    Note that some shared 
> memory allocations do reserve backing pages in swap, even though the pages 
> aren't currently in use.  Perhaps this is what you're measuring? 
>  "swap -s" has better numbers than top.
>
> You'd be better by trying a reboot then starting pgsql and seeing what 
> memory is used.
>
> Just because you start a process and see the swap number increase doesn't 
> mean that the new process is in swap.  It means some anonymous pages had 
> to be evicted to swap to make room for the new process or some pages had 
> to be reserved in swap for future use.   Typically a new process won't be 
> paged out unless something else is causing enormous memory pressure...
>
> -- Alan
>
>
> 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 17:04           ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 17:08             ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 19:01               ` Matt Clark <matt@ymogen.net>
  2005-01-19 19:46                 ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  0 siblings, 1 reply; 22+ messages in thread

From: Matt Clark @ 2005-01-19 19:01 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance

This page may be of use:

http://www.serverworldmagazine.com/monthly/2003/02/solaris.shtml

 From personal experience, for god's sake don't think Solaris' VM/swap 
implementation is easy - it's damn good, but it ain't easy!

Matt

Kevin Schroeder wrote:

> I think it's probably just reserving them.  I can't think of anything 
> else. Also, when I run swap activity with sar I don't see any 
> activity, which also points to reserved swap space, not used swap space.
>
> swap -s reports
>
> total: 358336k bytes allocated + 181144k reserved = 539480k used, 
> 2988840k available
>
> Kevin
>
> ----- Original Message ----- From: "Alan Stange" <stange@rentec.com>
> To: "Kevin Schroeder" <kschroeder@mirageworks.com>
> Cc: <pgsql-performance@postgresql.org>
> Sent: Wednesday, January 19, 2005 11:04 AM
> Subject: Re: [PERFORM] Swapping on Solaris
>
>
>> Kevin Schroeder wrote:
>>
>>> I may be asking the question the wrong way, but when I start up 
>>> PostgreSQL swap is what gets used the most of.  I've got 1282MB free 
>>> RAM right now and and 515MB swap in use.  Granted, swap file usage 
>>> probably wouldn't be zero, but I would guess that it should be a lot 
>>> lower so something must be keeping PostgreSQL from using the free 
>>> RAM that my system is reporting.  For example, one of my postgres 
>>> processes is 201M in size but on 72M is resident in RAM.  That extra 
>>> 130M is available in RAM, according to top, but postgres isn't using 
>>> it.
>>
>>
>> The test you're doing doesn't measure what you think you're measuring.
>>
>> First, what else is running on the machine?    Note that some shared 
>> memory allocations do reserve backing pages in swap, even though the 
>> pages aren't currently in use.  Perhaps this is what you're 
>> measuring?  "swap -s" has better numbers than top.
>>
>> You'd be better by trying a reboot then starting pgsql and seeing 
>> what memory is used.
>>
>> Just because you start a process and see the swap number increase 
>> doesn't mean that the new process is in swap.  It means some 
>> anonymous pages had to be evicted to swap to make room for the new 
>> process or some pages had to be reserved in swap for future use.   
>> Typically a new process won't be paged out unless something else is 
>> causing enormous memory pressure...
>>
>> -- Alan
>>
>>
>>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>      subscribe-nomail command to majordomo@postgresql.org so that your
>      message can get through to the mailing list cleanly




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 17:04           ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 17:08             ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 19:01               ` Re: Swapping on Solaris Matt Clark <matt@ymogen.net>
@ 2005-01-19 19:46                 ` Kevin Schroeder <kschroeder@mirageworks.com>
  0 siblings, 0 replies; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 19:46 UTC (permalink / raw)
  To: ; +Cc: pgsql-performance

Well, easy it ain't and I believe it's good.  One final question:  When I 
run sar -w I get no swap activity, but the process switch column registers 
between 400 and 700 switches per second.  Would that be in the normal range 
for a medium-use system?

Thanks
Kevin

----- Original Message ----- 
From: "Matt Clark" <matt@ymogen.net>
To: "Kevin Schroeder" <kschroeder@mirageworks.com>
Cc: <pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 1:01 PM
Subject: Re: [PERFORM] Swapping on Solaris


> This page may be of use:
>
> http://www.serverworldmagazine.com/monthly/2003/02/solaris.shtml
>
> From personal experience, for god's sake don't think Solaris' VM/swap 
> implementation is easy - it's damn good, but it ain't easy!
>
> Matt
>
> Kevin Schroeder wrote:
>
>> I think it's probably just reserving them.  I can't think of anything 
>> else. Also, when I run swap activity with sar I don't see any activity, 
>> which also points to reserved swap space, not used swap space.
>>
>> swap -s reports
>>
>> total: 358336k bytes allocated + 181144k reserved = 539480k used, 
>> 2988840k available
>>
>> Kevin
>>
>> ----- Original Message ----- From: "Alan Stange" <stange@rentec.com>
>> To: "Kevin Schroeder" <kschroeder@mirageworks.com>
>> Cc: <pgsql-performance@postgresql.org>
>> Sent: Wednesday, January 19, 2005 11:04 AM
>> Subject: Re: [PERFORM] Swapping on Solaris
>>
>>
>>> Kevin Schroeder wrote:
>>>
>>>> I may be asking the question the wrong way, but when I start up 
>>>> PostgreSQL swap is what gets used the most of.  I've got 1282MB free 
>>>> RAM right now and and 515MB swap in use.  Granted, swap file usage 
>>>> probably wouldn't be zero, but I would guess that it should be a lot 
>>>> lower so something must be keeping PostgreSQL from using the free RAM 
>>>> that my system is reporting.  For example, one of my postgres processes 
>>>> is 201M in size but on 72M is resident in RAM.  That extra 130M is 
>>>> available in RAM, according to top, but postgres isn't using it.
>>>
>>>
>>> The test you're doing doesn't measure what you think you're measuring.
>>>
>>> First, what else is running on the machine?    Note that some shared 
>>> memory allocations do reserve backing pages in swap, even though the 
>>> pages aren't currently in use.  Perhaps this is what you're measuring? 
>>> "swap -s" has better numbers than top.
>>>
>>> You'd be better by trying a reboot then starting pgsql and seeing what 
>>> memory is used.
>>>
>>> Just because you start a process and see the swap number increase 
>>> doesn't mean that the new process is in swap.  It means some anonymous 
>>> pages had to be evicted to swap to make room for the new process or some 
>>> pages had to be reserved in swap for future use.   Typically a new 
>>> process won't be paged out unless something else is causing enormous 
>>> memory pressure...
>>>
>>> -- Alan
>>>
>>>
>>>
>>
>>
>> ---------------------------(end of broadcast)---------------------------
>> TIP 3: if posting/reading through Usenet, please send an appropriate
>>      subscribe-nomail command to majordomo@postgresql.org so that your
>>      message can get through to the mailing list cleanly
>
>
>
> 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 17:36           ` Jeff <threshar@torgo.978.org>
  2 siblings, 0 replies; 22+ messages in thread

From: Jeff @ 2005-01-19 17:36 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance


On Jan 19, 2005, at 10:40 AM, Kevin Schroeder wrote:

> I may be asking the question the wrong way, but when I start up 
> PostgreSQL swap is what gets used the most of.  I've got 1282MB free 
> RAM right now and and 515MB swap in use.  Granted, swap file usage 
> probably wouldn't be zero, but I would guess that it should be a lot 
> lower so something must be keeping PostgreSQL from using the free RAM 
> that my system is reporting.  For example, one of my postgres 
> processes is 201M in size but on 72M is resident in RAM.  That extra 
> 130M is available in RAM, according to top, but postgres isn't using 
> it.

Can you please give us your exact shared_buffer and sort_mem settings?
This will help greatly.  As a general thing, we say don't use more than 
10k shared bufs unless you have done testing and enjoy a benefit. 
Managing all those buffers isn't free.

I'm also not sure how Solaris reports shared memory usage for apps... a 
lot of that could be shared mem.

Can you watch say, vmstat 1 for a minute or two while PG is running and 
see if you're actually swapping?

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 14:31     ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 15:30       ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:40         ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
@ 2005-01-19 23:47           ` Simon Riggs <simon@2ndquadrant.com>
  2 siblings, 0 replies; 22+ messages in thread

From: Simon Riggs @ 2005-01-19 23:47 UTC (permalink / raw)
  To: Kevin Schroeder <kschroeder@mirageworks.com>; +Cc: pgsql-performance

On Wed, 2005-01-19 at 09:40 -0600, Kevin Schroeder wrote:
> I may be asking the question the wrong way, but when I start up PostgreSQL 
> swap is what gets used the most of.  I've got 1282MB free RAM right now and 
> and 515MB swap in use.  Granted, swap file usage probably wouldn't be zero, 
> but I would guess that it should be a lot lower so something must be keeping 
> PostgreSQL from using the free RAM that my system is reporting.  For 
> example, one of my postgres processes is 201M in size but on 72M is resident 
> in RAM.  That extra 130M is available in RAM, according to top, but postgres 
> isn't using it.

You probably need to look at the way Solaris memory allocation works.

On Linux 2.6, my understanding is that if a process allocates memory,
but doesn't actually use it, then the OS is smart enough to swap the
overallocated portion out to swap. The effect of that is that the
program stays happy because it has all the "memory" it thinks it needs,
while the OS is happy because it conserves it valuable physical RAM for
memory that is actually being used.

If what I say is correct, you should actually observe very low swapping
I/O rates on the system.

Anyway, look at how the algorithms work if you are worried by what you
see. But mostly, if the system is performing OK, then no need to worry -
if your only measure of that is system performance data then you need to
instrument your application better, so you can look at the data that
really matters.

-- 
Best Regards, Simon Riggs




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
@ 2005-01-19 15:07     ` Greg Spiegelberg <gspiegelberg@cranel.com>
  2005-01-19 15:17       ` Re: Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  1 sibling, 1 reply; 22+ messages in thread

From: Greg Spiegelberg @ 2005-01-19 15:07 UTC (permalink / raw)
  To: stange@rentec.com; +Cc: Kevin Schroeder <kschroeder@mirageworks.com>; pgsql-performance

Alan Stange wrote:
> 
> Note that files in /tmp are usually in a tmpfs file system.   These 
> files may be the usage of swap that you're seeing (as they will be paged 
> out on an active system with some memory pressure)

You can do a couple things with /tmp.  Create a separate file system
for it so it will have zero impact on swap and use the "noatime" mount
option.  Alternatively, limit the size of /tmp using the mount option
"size=MBm" replacing "MB" with the size you want it to be in MBytes.  If
your application uses /tmp heavily, be sure to put it on a speedy,
local LUN.


> Finally, just as everyone suggests upgrading to newer postgresql 
> releases, you probably want to get to a newer Solaris release.

If you really want to avoid swapping I'd suggest tuning your database
first with swap turned off and put it under a "normal" load while
watching both top and vmstat.  When you're happy with it, turn swap
back on for those "heavy" load times and move on.

Greg

-- 
Greg Spiegelberg
  Product Development Manager
  Cranel, Incorporated.
  Phone: 614.318.4314
  Fax:   614.431.8388
  Email: gspiegelberg@cranel.com
Technology. Integrity. Focus.




^ permalink  raw  reply  [nested|flat] 22+ messages in thread

* Re: Swapping on Solaris
  2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
  2005-01-19 07:40 ` Re: Swapping on Solaris Mark Kirkwood <markir@coretech.co.nz>
  2005-01-19 13:51   ` Re: Swapping on Solaris Alan Stange <stange@rentec.com>
  2005-01-19 15:07     ` Re: Swapping on Solaris Greg Spiegelberg <gspiegelberg@cranel.com>
@ 2005-01-19 15:17       ` Kevin Schroeder <kschroeder@mirageworks.com>
  0 siblings, 0 replies; 22+ messages in thread

From: Kevin Schroeder @ 2005-01-19 15:17 UTC (permalink / raw)
  To: ; +Cc: pgsql-performance

/tmp doesn't seem to be much of a problem.  I have about 1k worth of data in 
there and 72k in /var/tmp.

Would turning swap off help in tuning the database in this regard?  top is 
reporting that there's 1.25GB of RAM free on a 2GB system so, in my 
estimation, there's no need for PostgreSQL to be swapped unless that free 
memory is Solaris caching files in RAM.

Kevin


----- Original Message ----- 
From: "Greg Spiegelberg" <gspiegelberg@cranel.com>
To: <stange@rentec.com>
Cc: "Kevin Schroeder" <kschroeder@mirageworks.com>; 
<pgsql-performance@postgresql.org>
Sent: Wednesday, January 19, 2005 9:07 AM
Subject: Re: [PERFORM] Swapping on Solaris


> Alan Stange wrote:
>>
>> Note that files in /tmp are usually in a tmpfs file system.   These files 
>> may be the usage of swap that you're seeing (as they will be paged out on 
>> an active system with some memory pressure)
>
> You can do a couple things with /tmp.  Create a separate file system
> for it so it will have zero impact on swap and use the "noatime" mount
> option.  Alternatively, limit the size of /tmp using the mount option
> "size=MBm" replacing "MB" with the size you want it to be in MBytes.  If
> your application uses /tmp heavily, be sure to put it on a speedy,
> local LUN.
>
>
>> Finally, just as everyone suggests upgrading to newer postgresql 
>> releases, you probably want to get to a newer Solaris release.
>
> If you really want to avoid swapping I'd suggest tuning your database
> first with swap turned off and put it under a "normal" load while
> watching both top and vmstat.  When you're happy with it, turn swap
> back on for those "heavy" load times and move on.
>
> Greg
>
> -- 
> Greg Spiegelberg
>  Product Development Manager
>  Cranel, Incorporated.
>  Phone: 614.318.4314
>  Fax:   614.431.8388
>  Email: gspiegelberg@cranel.com
> Technology. Integrity. Focus.
>
>
>
> 




^ permalink  raw  reply  [nested|flat] 22+ messages in thread


end of thread, other threads:[~2005-02-02 15:54 UTC | newest]

Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-18 22:49 Swapping on Solaris Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 07:40 ` Mark Kirkwood <markir@coretech.co.nz>
2005-01-19 09:57   ` Matt Casters <Matt.Casters@advalvas.be>
2005-01-19 14:52     ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 14:57     ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 15:42       ` Alan Stange <stange@rentec.com>
2005-01-19 15:53         ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 16:58         ` Jeff <threshar@torgo.978.org>
2005-01-27 21:36         ` Andrew Sullivan <ajs@crankycanuck.ca>
2005-02-02 15:54           ` Bruce Momjian <pgman@candle.pha.pa.us>
2005-01-19 13:51   ` Alan Stange <stange@rentec.com>
2005-01-19 14:31     ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 15:30       ` Alan Stange <stange@rentec.com>
2005-01-19 15:40         ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 17:04           ` Alan Stange <stange@rentec.com>
2005-01-19 17:08             ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 19:01               ` Matt Clark <matt@ymogen.net>
2005-01-19 19:46                 ` Kevin Schroeder <kschroeder@mirageworks.com>
2005-01-19 17:36           ` Jeff <threshar@torgo.978.org>
2005-01-19 23:47           ` Simon Riggs <simon@2ndquadrant.com>
2005-01-19 15:07     ` Greg Spiegelberg <gspiegelberg@cranel.com>
2005-01-19 15:17       ` Kevin Schroeder <kschroeder@mirageworks.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox