Hi, All
I design following 2 scenarios:
Scenario 1:
1.Initialize TWO zram devices with 100MB each.
#zramconfig /dev/zram0 --disksize_kb=102400 –init
#zramconfig /dev/zram1 --disksize_kb=102400 –init
2.Activate them as swap
#mkswap /dev/zram0
#mkswap /dev/zram1
#swapon /dev/zram0
#swapon /dev/zram1
Scenario 2:
1.Initialize ONE zram devices with 200MB
#zramconfig /dev/zram0 --disksize_kb=102400 –init
2.Activate it as swap
#mkswap /dev/zram0
#swapon /dev/zram0
Both of scenarios,I can find 200MB swap new added.then What's the
difference between the two scenarios ,especially for performance
influence?
Hope for you all feekback,thanks!
On Thu, Dec 23, 2010 at 2:48 PM, Mike Cao wrote: > Scenario 1: > 1.Initialize TWO zram devices with 100MB each....> Scenario 2: > 1.Initialize ONE zram devices with 200MB...> Both of scenarios,I can find 200MB swap new added.then What's the > difference between the two scenarios ,especially for performance > influence?Probably not much. I imagine the main difference is that in Scenario 1 you can adjust the amount of compcache more easily as you have the option of disabling one of the two 100MB swap devices. Presumably Scenario 1 uses up a little more memory. It may also reduce lock contention slightly on machines with lots of cores, but I am not familiar enough with the code to know if that is the case.
On Thu, 2010-12-23 at 15:16 +0800, John McCabe-Dansted wrote: > On Thu, Dec 23, 2010 at 2:48 PM, Mike Cao wrote: > > Scenario 1: > > 1.Initialize TWO zram devices with 100MB each. > ... > > Scenario 2: > > 1.Initialize ONE zram devices with 200MB > ... > > Both of scenarios,I can find 200MB swap new added.then What's the > > difference between the two scenarios ,especially for performance > > influence? > > Probably not much. I imagine the main difference is that in Scenario 1 > you can adjust the amount of compcache more easily as you have the > option of disabling one of the two 100MB swap devices.Hi ,I also think so. Please look at http://code.google.com/p/compcache/wiki/zcach... ,the last 2 items in details. *Separate partitions (all ext4) for: /boot, / and /home. So, three separate zcache pools *Each pool with default memlimit: 10% of RAM (memory is allocated on-demand and is not pre-allocated) I wonder whether the /dev/zramX means zcache pools ?if it is ,why need three?> > Presumably Scenario 1 uses up a little more memory. It may also reduce > lock contention slightly on machines with lots of cores, but I am not > familiar enough with the code to know if that is the case. >
On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao wrote: > I wonder whether the /dev/zramX means zcache pools?From the page you linked "zram can be used to provide a compressed swap, while zcache compresses filesystem cache pages". AFAICT zram and zcache are two different tools for two different purposes. > if it is ,why need three? Maybe Zcache needs to have a different pool for each partition it caches? "Separate partitions (all ext4) for: /boot, / and /home. So, three separate zcache pools"
On Thu, 2010-12-23 at 19:07 +0800, John McCabe-Dansted wrote: > On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao wrote: > > I wonder whether the /dev/zramX means zcache pools? > > From the page you linked "zram can be used to provide a compressed > swap, while zcache compresses filesystem cache pages". AFAICT zram and > zcache are two different tools for two different purposes. >I thought they should be the same thing, zcache now called zram.if not ,how we can make zcache tool ?> > if it is ,why need three? > > Maybe Zcache needs to have a different pool for each partition it caches? > "Separate partitions (all ext4) for: /boot, / and /home. So, three > separate zcache pools" >
On Fri, Dec 24, 2010 at 2:48 PM, Mike Cao wrote: > On Thu, 2010-12-23 at 19:07 +0800, John McCabe-Dansted wrote: >> On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao wrote: >> > I wonder whether the /dev/zramX means zcache pools? >> >> From the page you linked "zram can be used to provide a compressed >> swap, while zcache compresses filesystem cache pages". AFAICT zram and >> zcache are two different tools for two different purposes. >> > I thought they should be the same thing, zcache now called zram.if > not ,how we can make zcache tool ?I haven't found instructions on how to use zcache, but the difference between zram and zcache is discussed here: http://lwn.net/Articles/397574/
On 12/24/2010 02:05 AM, John McCabe-Dansted wrote:
> On Fri, Dec 24, 2010 at 2:48 PM, Mike Cao<bcao@redhat.com> wrote:
>> On Thu, 2010-12-23 at 19:07 +0800, John McCabe-Dansted wrote:
>>> On Thu, Dec 23, 2010 at 6:24 PM, Mike Cao<bcao@redhat.com> wrote:
>>>> I wonder whether the /dev/zramX means zcache pools?
>>>
>>> From the page you linked "zram can be used to provide a compressed
>>> swap, while zcache compresses filesystem cache pages". AFAICT zram and
>>> zcache are two different tools for two different purposes.
>>>
>> I thought they should be the same thing, zcache now called zram.if
>> not ,how we can make zcache tool ?
>
> I haven't found instructions on how to use zcache, but the difference
> between zram and zcache is discussed here:
>
> http://lwn.net/Articles/397574/
>The article is slightly misleading -- it gives the impression that
zcache was developed to *replace* zram. In fact, zram and zcache are
quite different: zcache compresses filesystem caches only and not
anonymous (heap) pages, OTOH zram compression only anonymous pages and
not pagecache pages.
Currently, there is no easy way to test zcache as cleancache -- which is
zcache's backend -- is not yet in mainline (or even staging).
Nitin