免费注册 查看新帖 |

Chinaunix

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

关于swap mirror的一个有趣的讨论 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-06-24 21:22 |只看该作者 |倒序浏览
以下是我订阅的一个mail list的一个讨论话题,很有意思,请大家看看:


Today's Topics:

   1. To mirror (swap) or not to mirror - that is the question...
(Donaldson, Mark)
   2. Re: To mirror (swap) or not to mirror - that is the
       question... (Doug Hughes)
   3. Re: To mirror (swap) or not to mirror - that is the
       question... (Yves Dorfsman)
   4. Re: To mirror (swap) or not to mirror - that is the question...
(Eric Forgette)
   5. Re: RE: [Veritas-vx] (no subject) (veritas oracle sun)
   6. Re: To mirror (swap) or not to mirror - that is the question...
(John Cronin)


message 1:

Subject: [Veritas-vx] To mirror (swap) or not to mirror - that is the
question...

We debate around the office whether to mirror swap or not.

I'm of the "don't mirror" camp.  My thought is that swap should
emmulate
memory, therefore it should be as fast as possible & not spend,
therefore,
the cycles to mirror.  The other benefit is that I can double my swap
if I
detach the mirror & remount it as an additional swap volume.

The "mirror it" campers point out that if we lose a disk, we lose swap
information if non-mirror & will probably therefore crash. It's not HA,
really.


So, I put it to all you.  What's your $.02?



message 2:
Subject: Re: [Veritas-vx] To mirror (swap) or not to mirror - that is
the
question...

On Wed, 11 Jun 2003, Donaldson, Mark wrote:

>; We debate around the office whether to mirror swap or not.
>;
>; I'm of the "don't mirror" camp.  My thought is that swap should
emmulate
>; memory, therefore it should be as fast as possible & not spend,
therefore,
>; the cycles to mirror.  The other benefit is that I can double my swap
if I
>; detach the mirror & remount it as an additional swap volume.
>;
>; The "mirror it" campers point out that if we lose a disk, we lose
swap
>; information if non-mirror & will probably therefore crash. It's not
HA,
>; really.
>;
>;
>; So, I put it to all you.  What's your $.02?
>;
both right. If you're doing a lot of paging, get more memory.
I tend to mirror swap if I can't afford a crash if the swap disk
errs. If it doesn't matter if the machine crashes (architectural
failover), then I don't mirror it.

(most of the time I mirror it)


message 3:
Subject: Re: [Veritas-vx] To mirror (swap) or not to mirror - that is
the question...


On Wed, 11 Jun 2003, Donaldson, Mark wrote:

>; I'm of the "don't mirror" camp.  My thought is that swap should
emmulate
>; memory, therefore it should be as fast as possible & not spend,
therefore,
>; the cycles to mirror.

.../...

>; The "mirror it" campers point out that if we lose a disk, we lose
swap
>; information if non-mirror & will probably therefore crash. It's not
HA,
>; really.

I am definitely in the second camp, I typically look after financial
system where the first priority is no outage. We had this debate on my
current contract. Money was not too much of a problem on this project,
and
we sized the memory big enough so that the machine should never swap.
Some
people didn't want to put swap at all... The next thing was about
mirroring the swap or not. Basically it comes down to sacrifying a
little
bit of performance to avoid that one outage that you will have - Disks
are
the first thing to fail.



message 4:
Subject: Re: [Veritas-vx] To mirror (swap) or not to mirror - that is
the question...

If this is a poll, here is my vote:
Technically, mirrored swap should have a slight performance penalty
during writes.  Reads actually should be faster.  But the real issue is
that disks, being the only mechanical devices in the equation, tend to
fail more often than anything else.  Memory these days is relatively
cheap (I've got a gig in my laptop).  I'd suggest sizing the box with
all the physical memory you need, and mirror the swap devices.  This
should address both the performance and availability issues.

Just my $.02
-Eric

On Wednesday, June 11, 2003, at 02:57 PM,
veritas-vx-admin@mailman.eng.auburn.edu wrote:

>; We debate around the office whether to mirror swap or not.
>; ...



message 6:

Subject: Re: [Veritas-vx] To mirror (swap) or not to mirror - that is
the question...

Eric Forgette wrote:
>;
>; If this is a poll, here is my vote:
>; Technically, mirrored swap should have a slight performance penalty
>; during writes.  Reads actually should be faster.

I am not sure if this is true.  If you put swap on two disks, I seem
to recall that Solaris will interleave between them, which should give
similar performance to round-robin between mirrors.  The difference
is that mirrors have duplicate info on the disks, and swap on multiple
partitions operates loosely like a stripe (with a big interleave
value).
Linux has a similar behavior.  Still, I agree that if you don't pay
a performance penalty, and that mirrored swap is faster than a single
unmirrored swap partition.

>; But the real issue is
>; that disks, being the only mechanical devices in the equation, tend
to
>; fail more often than anything else.

Absolutely.

>; Memory these days is relatively
>; cheap (I've got a gig in my laptop).  I'd suggest sizing the box with
>; all the physical memory you need, and mirror the swap devices.  This
>; should address both the performance and availability issues.

Disks are pretty cheap too these days.  If you don't want to be called
in the middle of the night after a disk failed and a machine rebooted
because swap failed, mirrored swap is cheap insurance - I always mirror
the entire boot disk anyway, and make sure the mirror is bootable.

Also, frankly, for most applications, if your system is running Solaris
and swapping significantly, you should probably buy more RAM.  Paging
is
normal in Solaris, but swapping is a sign of a system under stress
these
days, unlike SunOS and other older Unix variants that allocated a copy
of almost ANY memory in swap, hence the old minimum of 2X RAM.  These
days, with demand paging and only swapping out anonymous memory, I
often
run systems with swap that is significantly smaller than RAM (ie 8 GB
RAM and 2 GB swap) and I don't see any problems.  I have had
application
developers demand 48 GB swap on a system with 24 GB RAM, and I have
just
had to politely refuse, and then less politely refuse.

论坛徽章:
0
2 [报告]
发表于 2003-06-24 21:27 |只看该作者

关于swap mirror的一个有趣的讨论

又一个人的补充:
The OS will interleave writes among swap devices in what I think is a
1MB default. This is why it's a bad idea to have multiple swap devices
on the same physical disk
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP