Strange "df -k" output for /tmpfs

Strange "df -k" output for /tmpfs

Post by Ron Kelle » Sun, 21 Jul 2002 20:04:47



Hello,

I am having a bit of trouble trying to figure out how Solaris 2.6 (and
Solaris 8) calculates the memory size for /tmpfs (specifically the "df"
command).  On a number of our Solaris serves (U5s, U60s, etc), we have
mounted /tmpfs via entry in /etc/vfstab.  However, the "df -k /tmpfs"
command does not always produce expected results.  Here is an example:

entry in /etc/vfstab:
-------------------
swap    -       /tmp    tmpfs   -       yes     -

"swap -l" produces this result:
---------------------------------------
swapfile                    dev      swaplo   blocks     free
/dev/dsk/c0t0d0s1   135,1      16     4096496 2398224

"swap -s" produces this result:
---------------------------------------
total: 1263896k bytes allocated + 117008k reserved = 1380904k used, 1453232k
available

The "prtdiag" command tells me this server has 1GB of  RAM.

However, if I run "df -k /tmp", the following output is displayed:
-----------------------------------------------------------------------
Filesystem           1k-blocks      Used    Available     Use%    Mounted on
swap                   2224984    773832     1451152     35%      /tmp

I would have expected to see 3072000 1k-blocks (or something similar)
because 1GB RAM plus 2GB swap is 3GB total system virtual memory.

What am I missing?

Thanks in advance,

-Ron

 
 
 

Strange "df -k" output for /tmpfs

Post by CH » Mon, 22 Jul 2002 09:25:17


Not completedly sure I understand the question.

If you want to know what space is being used by the files in /tmp, you can
try

du -sk /tmp

Also, you don't have to make a tmpfs the fullsize of swap.  After all what
godo is it if you run of swap due to junk in /tmp.

You could use the following type of entry in /etc/vfstab
swap - /tmp tmpfs - yes size=512m

Realize that swap space is not only going to be used by your /tmp, but also
as memory for system process.   The more swap space used, the less space
that will be available in /tmp under your configuration.

If you want to keep a running tab on how much swap is available
(interactively), you can run
vmstat 1


Quote:> Hello,

> I am having a bit of trouble trying to figure out how Solaris 2.6 (and
> Solaris 8) calculates the memory size for /tmpfs (specifically the "df"
> command).  On a number of our Solaris serves (U5s, U60s, etc), we have
> mounted /tmpfs via entry in /etc/vfstab.  However, the "df -k /tmpfs"
> command does not always produce expected results.  Here is an example:

> entry in /etc/vfstab:
> -------------------
> swap    -       /tmp    tmpfs   -       yes     -

> "swap -l" produces this result:
> ---------------------------------------
> swapfile                    dev      swaplo   blocks     free
> /dev/dsk/c0t0d0s1   135,1      16     4096496 2398224

> "swap -s" produces this result:
> ---------------------------------------
> total: 1263896k bytes allocated + 117008k reserved = 1380904k used,
1453232k
> available

> The "prtdiag" command tells me this server has 1GB of  RAM.

> However, if I run "df -k /tmp", the following output is displayed:
> -----------------------------------------------------------------------
> Filesystem           1k-blocks      Used    Available     Use%    Mounted
on
> swap                   2224984    773832     1451152     35%      /tmp

> I would have expected to see 3072000 1k-blocks (or something similar)
> because 1GB RAM plus 2GB swap is 3GB total system virtual memory.

> What am I missing?

> Thanks in advance,

> -Ron


 
 
 

Strange "df -k" output for /tmpfs

Post by Dave Uhrin » Mon, 22 Jul 2002 10:15:35




> #   Not completedly sure I understand the question.

> Completedly understand not to top-post, cause now
> you're confusing everyone due to lack of context.

> This is not MicroSoft email. This is Usenet.

The problem is the default setup of Outhouse Express.  For a logical and
tempered screed about that POS see

http://fmf.fwn.rug.nl/~anton/topposting.html

which also references the appropriate RFC.

 
 
 

Strange "df -k" output for /tmpfs

Post by Casper H.S. Di » Mon, 22 Jul 2002 17:21:24



>I would have expected to see 3072000 1k-blocks (or something similar)
>because 1GB RAM plus 2GB swap is 3GB total system virtual memory.
>What am I missing?

The "size" only takes into account the actual available virtual memory
plus whatever was allocated for tmpfs; i.e., the size field shrinks
when processes use more virtual memory.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

Strange "df -k" output for /tmpfs

Post by Ron Kelle » Tue, 23 Jul 2002 01:57:47


<snip>

Quote:> The "size" only takes into account the actual available virtual memory
> plus whatever was allocated for tmpfs; i.e., the size field shrinks
> when processes use more virtual memory.

> Casper

OK - I think I understand now.  Using the above logic, are the following
assumptions correct?

* When I first boot my box (or have very minimal processes running), the
"size" field in "df -k /tmp" should be close to "Swap + Main Memory".  This
is because programs have *not* been swapped out yet (and they don't reside
in /tmp).

* As processes consume swap (not in /tmp), the "size" field in "df -k /tmp"
should *decrease* correspondingly.

We are running a development lab using a 3rd Party DB system that stores
database cache files in /tmp.  Many times our servers crash because /tmp
gets filled and the kernel simply panics because not enough memory is left
to manage the box.  One suggestion I made is to add the "size=<xxx>" field
to the tmpfs entry in the vfstab.  I was thinking a good value for size=xxx
parameter wold be "<swap+main> - 125MB".  Is this a good assumption?  We
just want to make sure filling /tmp does not crash the system.  Any other
thoughts?

Many thanks,

-Ron

 
 
 

1. Strange "df" output on Solaris 9

I've just installed Solaris 9 on a SunFire v210 (Our first machine
with Solaris 9!!) - And I'm getting (what appears to be) some strange
results from the "df" command.

For example:-

# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d0       6198606 2345905 3790715    39%    /
/proc                      0       0       0     0%    /proc
mnttab                     0       0       0     0%    /etc/mnttab
fd                         0       0       0     0%    /dev/fd
/dev/md/dsk/d30      4133838  147773 3944727     4%    /var
swap                 5633960      32 5633928     1%    /var/run
swap                 5635176    1248 5633928     1%    /tmp
/dev/md/dsk/d70      2033311 18446744073709540285 1983643
935285293285725% /export/home
/export/home/adavis  2033311 18446744073709540285 1983643
935285293285725% /home/adavis

...Any idea why I'm getting these funny numbers for "/export/home",
and why do I get an entry for "/export/home/adavis" when this is not a
separate filesystem?

Many Thanks,
   =Adrian=

2. Multilink tunnel - is that possible

3. different free space result by "ls -a" and "df -k"

4. isdn-Zugang (windoofs -> linux)

5. Question on "df -k" command on aix 4.3.3

6. subnetting ???

7. Partitions - and a bug with "df -k"?

8. doom dont start

9. Strange "w", "who" and "uptime" output

10. Strange problem: "man -k" printing double!

11. sorting output of "df" command

12. Problems with "df" and "du" on "/var"

13. strange output of "who am I" & "last" on solaris 9