• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

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

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: | 查看: 19次 | 进入软件测试论坛讨论

领测软件测试网
以下是我订阅的一个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.

 solaris_engineer 回复于:2003-06-24 21:27:30
又一个人的补充:
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

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网