免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2912 | 回复: 6
打印 上一主题 下一主题

有人说/tmp 是物理内存,是这样的吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-14 10:44 |只看该作者 |倒序浏览
今天SUN的工程师过来这么说,我觉得有点奇怪,好象只有SUN的/TMP是物理内存,别的OS的/TMP是磁盘

论坛徽章:
0
2 [报告]
发表于 2007-03-14 10:48 |只看该作者
Nope. /tmp mounts your virtual swap space, which is the physical swap space + the free memory at that time. So the Sun engineer is half right. In Solaris /tmp is not your ordinary hard disk space

论坛徽章:
0
3 [报告]
发表于 2007-03-14 10:55 |只看该作者
原帖由 briangao 于 2007-3-14 10:48 发表\r\nNope. /tmp mounts your virtual swap space, which is the physical swap space + the free memory at that time. So the Sun engineer is half right. In Solaris /tmp is not your ordinary hard disk space
\r\n\r\n  谢谢,在系统中我看了一下\r\nswap                   798M    20K   798M     1%    /var/run\r\nswap                   798M     0K   798M     0%    /tmp\r\n\r\n有2个疑问\r\n\r\n1  有2个SWAP,一个就是你说的 /TMP,这个是物理内存和物理swap space的混合体,但是还有另外一个/var/run,这个就应该全部都是物理磁盘把,有2个SWAP是不是为了负载平衡\r\n\r\n2  听说如果在/TMP里面放很多临时文件的话,把/TMP占满后,系统就会很慢,处于有2个SWAP来实现负载平衡的需要,/var/run所在的SWAP好象没有发挥什么作用?

论坛徽章:
0
4 [报告]
发表于 2007-03-14 11:18 |只看该作者
1  有2个SWAP,一个就是你说的 /TMP,这个是物理内存和物理swap space的混合体,但是还有另外一个/var/run,这个就应该全部都是物理磁盘把,有2个SWAP是不是为了负载平衡
\r\nNo, Both /var/run and /tmp points to the same virtual swap space. /var/run is writable by system process and root user only. /tmp is writable by all users\r\n\r\n
2  听说如果在/TMP里面放很多临时文件的话,把/TMP占满后,系统就会很慢,处于有2个SWAP来实现负载平衡的需要,/var/run所在的SWAP好象没有发挥什么作用?
\r\nYes, it you fill up /tmp, it is equivalent that you use up all the memory and machine will start to swap.

论坛徽章:
0
5 [报告]
发表于 2007-03-14 11:21 |只看该作者
原帖由 Solaris12 于 2007-3-14 11:07 发表\r\n\r\n\r\n\r\n很多应用程序喜欢用/var/run存放临时文件,所以,/var/run是swap可以加快速度。\r\n\r\n关于tmp,可以看:\r\nbash-3.00# man tmpfs\r\nReformatting page.  Please Wait... done\r\n\r\nFile Systems                  ...
\r\n\r\n\r\n  谢谢\r\n\r\n# df -n\r\n \r\n/var/run           : tmpfs   \r\n/tmp               : tmpfs \r\n\r\n\r\n  从这个里面看所有的SWAP都是同一种文件\r\n\r\ntmpfs is a  memory  based  file  system  which  uses  kernel resources relating to the VM system and page cache as a file system\r\n\r\n  从这个里面看,说tmpfs 是一种以MEMORY为基础的的文件系统,我不太明白这个是什么意思?\r\n\r\n  在我看的资料中,里面说有一个分区,一般都是C0T0D0S0做SWAP,那这个怎么和以MEMORY为基础的文件系统相矛盾?

论坛徽章:
0
6 [报告]
发表于 2007-03-14 11:24 |只看该作者
原帖由 briangao 于 2007-3-14 11:18 发表\r\n\r\nNo, Both /var/run and /tmp points to the same virtual swap space. /var/run is writable by system process and root user only. /tmp is writable by all users\r\n\r\n\r\nYes, it you fill up /tmp, it is equ ...
\r\n\r\n\r\n  谢谢大师  \r\n\r\n  但是我还是不明白,这个physical swap space + the free memory表示什么意思?\r\n\r\n  难道说这个SWAP是物理磁盘和物理内存的混合体?只是这个对USER来说是透明的?

论坛徽章:
0
7 [报告]
发表于 2007-03-14 11:35 |只看该作者
难道说这个SWAP是物理磁盘和物理内存的混合体?只是这个对USER来说是透明的?
\r\nYou can think of it as a concatenation of the swap partition (such as c0t0d0s1) on your hard disk and the free memory at that time, formated into one file system called swapfs. It is mounted under /tmp directory for convenience so that users and processes can use regular file system semantics to access the information. This kind of file system is called memory-based file system or pseduo file system. There are quite a few of such file systems in Solaris such as /proc.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP