Re: [gentoo-user] more on SSD: swap

2013-07-26 Thread Markus Kaindl
Am 21.07.2013 16:42, schrieb Peter Wilmott:
 On 21/07/13 15:31, luis jure wrote:
 OK, now i have my system successfully installed and running on my new
 SSD.
 now i have to decide what to do with the rest of the disk (it's a 256MB
 samsung).

 the first big question is: what about swap? i found some web pages
 (perhaps old) stating that it's not wise to put swap on the SSD
 because of
 all the read/writes. but apparently from what i read on the recent
 thread on this list, that shouldn't be much of a concern now.

 i also read somewhere that if you have swap on the SSD and want to avoid
 unnecessary read/writes, you can reduce swappiness. i have 12GB RAM and i
 think normally i don't really need swap space on disk, so i thought that
 could be a good idea.

 so what i'm planning to do now is:

 - put swap on the SSD
 - reduce swappiness
 - put /var/tmp/portage on tmpfs

 so, do you guys think that's a good setup?

 TBH, unless you are really stressing your RAM usage (Lots of VMs or Java
 applications, stuff like that) I'd go without swap. I've been running
 swapless on 8GB of RAM for a number of years now with no issues.
 
 As for /var/tmp/portage on tmpfs, this is fine 95% of the time, however
 even with ~2GB I allocate some packages (Chromium, LibreOffice, ect)
 will fail to compile due to lack of space. In these cases I just
 un-mount /var/tmp/portage, do the compile on the disk, and then re-mount
 it.
 

Portage can do that for you for packages you know to need that much space:
markus@Nanga-Parbat ~ $ cat /etc/portage/env/notmpfs
PORTAGE_TMPDIR=/var/tmp_notmpfs
[Fr 26.07.13 22:06 CEST][pts/2][x86_64/linux-gnu/3.10.1-gentoo][5.0.2]
markus@Nanga-Parbat ~ $ cat /etc/portage/package.env
www-client/firefox notmpfs
[Fr 26.07.13 22:06 CEST][pts/2][x86_64/linux-gnu/3.10.1-gentoo][5.0.2]
markus@Nanga-Parbat ~ $ mount | grep /var/tmp
/dev/mapper/Nanga--Parbat--SSD-system--var--tmp_notmpfs on
/var/tmp_notmpfs type btrfs (rw,noatime,ssd,autodefrag,compress=lzo)
none on /var/tmp type tmpfs (rw,size=6350m)

(Firefox is still in there from my pgo-builds, I should remove that now :D)

Also:
markus@Nanga-Parbat ~ $ free -h
 total   used   free sharedbuffers cached
Mem:   15G12G   3,6G 0B   336M   6,0G
-/+ buffers/cache:   5,7G   9,9G
Swap:   0B 0B 0B

never had any problems without swap, since i got more than 4GB of RAM ;)

Regards,
Markus



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] more on SSD: swap

2013-07-22 Thread Alan McKinnon
On 22/07/2013 00:19, William Kenworthy wrote:
 swap: this will make one of the bigger speedups to the system when you
 need swap.  swap is good - yes you can do without it, but the day comes
 when you REALLY do want it, and ... [crash!] ... otherwise it can just
 sit there waiting :)
 
 /etc/sysctl.conf:
 
 #vm.swappiness=1
 #vm.vfs_cache_pressure=50
 


Do those settings set on the host or on the guest?



-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] more on SSD: swap

2013-07-22 Thread Dale

William Kenworthy wrote:

On 21/07/13 22:31, luis jure wrote:

OK, now i have my system successfully installed and running on my new SSD.
now i have to decide what to do with the rest of the disk (it's a 256MB
samsung).

the first big question is: what about swap? i found some web pages
(perhaps old) stating that it's not wise to put swap on the SSD because of
all the read/writes. but apparently from what i read on the recent
thread on this list, that shouldn't be much of a concern now.

i also read somewhere that if you have swap on the SSD and want to avoid
unnecessary read/writes, you can reduce swappiness. i have 12GB RAM and i
think normally i don't really need swap space on disk, so i thought that
could be a good idea.

so what i'm planning to do now is:

- put swap on the SSD
- reduce swappiness
- put /var/tmp/portage on tmpfs

so, do you guys think that's a good setup?


swap: this will make one of the bigger speedups to the system when you
need swap.  swap is good - yes you can do without it, but the day comes
when you REALLY do want it, and ... [crash!] ... otherwise it can just
sit there waiting :)

/etc/sysctl.conf:

#vm.swappiness=1
#vm.vfs_cache_pressure=50

these were recommended to me for running vm's and seem to do the job
(usually I am running with a several GB of swap (16G ram, 16G swap) in
use ... these settings definitely minimise it though big rsync jobs
stall when it fills ram+swap.

/var/tmp/portage is a more difficult one ... a long thread way back
(Dale, I think you were in it) looking at speed showed there was no
speed advantage to compiling in tempfs because spinner) disk caching was
so good the data only hit the disk when necessary.  I presume the same
will apply with compiling and SSD's in that the actual writes will be
minimal (in the scheme of things) so it shouldn't be a worry.  My
experience with compiling in tempfs is that it works, but has a much
higher failure rate than on disk - i.e., things like OO/Lo, KDE, gcc and
glibc have large space requirements that you must make sure tmpfs can
satisfy before you start.  And if its a busy machine actively using lots
of ram it gets hard.  I am making the point that most machines today
are way overprovisioned but when you are near the edge, saying things
like I gave xGB ram and never needed swap, so you wont either is
misrepresenting the situation.

BillK




Yes, I did so some testing on whether portage's work directory on tmpfs 
instead of HDD was faster or not and it wasn't much difference.  I 
actually had a couple times where it was faster on HDD but could have 
been that some other process took up a few seconds of time too.  The 
difference was literally seconds on compiles that were between 30 
minutes to one hour.


Dale

:-)  :-)

--
I am only responsible for what I said ... Not for what you understood or how 
you interpreted my words!




Re: [gentoo-user] more on SSD: swap

2013-07-22 Thread William Kenworthy
On 22/07/13 14:24, Alan McKinnon wrote:
 On 22/07/2013 00:19, William Kenworthy wrote:
 swap: this will make one of the bigger speedups to the system when you
 need swap.  swap is good - yes you can do without it, but the day comes
 when you REALLY do want it, and ... [crash!] ... otherwise it can just
 sit there waiting :)

 /etc/sysctl.conf:

 #vm.swappiness=1
 #vm.vfs_cache_pressure=50


 Do those settings set on the host or on the guest?



Host ... they are applied via pressure on the guest memory via the
balloon driver.  The couple of windows images seem to create problems
for the linux images in that linux seems to work better together but
with windows hogging the memory (worst case is a win7 and win8 running
concurrently, nether play well.)  Have not looked further than reducing
the memory allocated to windows (which triggered a genuine windows check
on win7!) so they co-exist uneasily

BillK





Re: [gentoo-user] more on SSD: swap

2013-07-22 Thread Alan McKinnon
On 22/07/2013 10:46, William Kenworthy wrote:
 On 22/07/13 14:24, Alan McKinnon wrote:
 On 22/07/2013 00:19, William Kenworthy wrote:
 swap: this will make one of the bigger speedups to the system when you
 need swap.  swap is good - yes you can do without it, but the day comes
 when you REALLY do want it, and ... [crash!] ... otherwise it can just
 sit there waiting :)

 /etc/sysctl.conf:

 #vm.swappiness=1
 #vm.vfs_cache_pressure=50


 Do those settings set on the host or on the guest?



 Host ... they are applied via pressure on the guest memory via the
 balloon driver.  The couple of windows images seem to create problems
 for the linux images in that linux seems to work better together but
 with windows hogging the memory (worst case is a win7 and win8 running
 concurrently, nether play well.)  Have not looked further than reducing
 the memory allocated to windows (which triggered a genuine windows check
 on win7!) so they co-exist uneasily
 
 BillK
 
 
 


thanks

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] more on SSD: swap

2013-07-22 Thread Volker Armin Hemmann
Am Montag, 22. Juli 2013, 06:19:09 schrieb William Kenworthy:
 experience with compiling in tempfs is that it works, but has a much
 higher failure rate than on disk - i.e., things like OO/Lo, KDE, gcc and
 glibc have large space requirements that you must make sure tmpfs can
 satisfy before you start.

em, no. KDE does not have large space requirements. LO does. The rest is happy 
with 2gb of tmpfs diskspace.


-- 
#163933



Re: [gentoo-user] more on SSD: swap

2013-07-22 Thread Neil Bothwick
On Mon, 22 Jul 2013 10:49:48 +0200, Volker Armin Hemmann wrote:

  experience with compiling in tempfs is that it works, but has a much
  higher failure rate than on disk - i.e., things like OO/Lo, KDE, gcc
  and glibc have large space requirements that you must make sure tmpfs
  can satisfy before you start.  
 
 em, no. KDE does not have large space requirements. LO does. The rest
 is happy with 2gb of tmpfs diskspace.

And portage checks for sufficient space for greedy packages before it
starts emerging anything, so if there is a problem you know right away.


-- 
Neil Bothwick

Therapy is expensive, popping bubble wrap is cheap! You choose.


signature.asc
Description: PGP signature


[gentoo-user] more on SSD: swap

2013-07-21 Thread luis jure

OK, now i have my system successfully installed and running on my new SSD.
now i have to decide what to do with the rest of the disk (it's a 256MB
samsung).

the first big question is: what about swap? i found some web pages
(perhaps old) stating that it's not wise to put swap on the SSD because of
all the read/writes. but apparently from what i read on the recent
thread on this list, that shouldn't be much of a concern now. 

i also read somewhere that if you have swap on the SSD and want to avoid
unnecessary read/writes, you can reduce swappiness. i have 12GB RAM and i
think normally i don't really need swap space on disk, so i thought that
could be a good idea.

so what i'm planning to do now is:

- put swap on the SSD 
- reduce swappiness 
- put /var/tmp/portage on tmpfs

so, do you guys think that's a good setup?



Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Jarry

On 21-Jul-13 16:31, luis jure wrote:


so what i'm planning to do now is:

- put swap on the SSD
- reduce swappiness
- put /var/tmp/portage on tmpfs

so, do you guys think that's a good setup?


Sounds good to me. But with 12GB RAM the question is:
Do you need swap at all?

Jarry
--
___
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.



Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Peter Wilmott

On 21/07/13 15:31, luis jure wrote:

OK, now i have my system successfully installed and running on my new SSD.
now i have to decide what to do with the rest of the disk (it's a 256MB
samsung).

the first big question is: what about swap? i found some web pages
(perhaps old) stating that it's not wise to put swap on the SSD because of
all the read/writes. but apparently from what i read on the recent
thread on this list, that shouldn't be much of a concern now.

i also read somewhere that if you have swap on the SSD and want to avoid
unnecessary read/writes, you can reduce swappiness. i have 12GB RAM and i
think normally i don't really need swap space on disk, so i thought that
could be a good idea.

so what i'm planning to do now is:

- put swap on the SSD
- reduce swappiness
- put /var/tmp/portage on tmpfs

so, do you guys think that's a good setup?

TBH, unless you are really stressing your RAM usage (Lots of VMs or Java 
applications, stuff like that) I'd go without swap. I've been running 
swapless on 8GB of RAM for a number of years now with no issues.


As for /var/tmp/portage on tmpfs, this is fine 95% of the time, however 
even with ~2GB I allocate some packages (Chromium, LibreOffice, ect) 
will fail to compile due to lack of space. In these cases I just 
un-mount /var/tmp/portage, do the compile on the disk, and then re-mount 
it.




Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Alan McKinnon
On 21/07/2013 16:34, Jarry wrote:
 On 21-Jul-13 16:31, luis jure wrote:

 so what i'm planning to do now is:

 - put swap on the SSD
 - reduce swappiness
 - put /var/tmp/portage on tmpfs

 so, do you guys think that's a good setup?
 
 Sounds good to me. But with 12GB RAM the question is:
 Do you need swap at all?
 
 Jarry


yes, he does, but not for the reason most people think

tmpfs is backed by swap :-)



Swap was originally introduced way back in the 60s as a
workaround for computers that had far less RAM than the workload
strictly needed. This has not fundamentally changed in any significant
way 40 years later so like you, I always favour having enough RAM.

And RAM is MUCH cheaper than SSDs and requires no fiddling and tweaking
to be able to use it.

-- 
Alan McKinnon
alan.mckin...@gmail.com




Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread luis jure
on 2013-07-21 at 15:42 Peter Wilmott wrote:

 TBH, unless you are really stressing your RAM usage (Lots of VMs or Java 
 applications, stuff like that) I'd go without swap.

it's true that most of the time 12BG is more than enough for me and i
don't use swap space on disk. i wouldn't go for a swapless system, though,
specially since i'm going to put things on tmpfs.

a few GB (i'm thinking about 8) of swap space on disk won't hurt, and i'd
feel safer. that's the idea of reducing swappiness to 1 or 0, anyway.

best,


lj



Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Florian Philipp
Am 21.07.2013 17:39, schrieb luis jure:
 on 2013-07-21 at 15:42 Peter Wilmott wrote:
 
 TBH, unless you are really stressing your RAM usage (Lots of VMs or Java 
 applications, stuff like that) I'd go without swap.
 
 it's true that most of the time 12BG is more than enough for me and i
 don't use swap space on disk. i wouldn't go for a swapless system, though,
 specially since i'm going to put things on tmpfs.
 
 a few GB (i'm thinking about 8) of swap space on disk won't hurt, and i'd
 feel safer. that's the idea of reducing swappiness to 1 or 0, anyway.
 

Also think about using zswap or frontswap. Both work well despite still
being in staging in current kernels. Zswap will be stabilized in kernel
3.11, I think.

Regards,
Florian Philipp




signature.asc
Description: OpenPGP digital signature


Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Volker Armin Hemmann
Am Sonntag, 21. Juli 2013, 11:31:41 schrieb luis jure:
 OK, now i have my system successfully installed and running on my new SSD.
 now i have to decide what to do with the rest of the disk (it's a 256MB
 samsung).
 
 the first big question is: what about swap? i found some web pages
 (perhaps old) stating that it's not wise to put swap on the SSD because of
 all the read/writes. but apparently from what i read on the recent
 thread on this list, that shouldn't be much of a concern now.
 
 i also read somewhere that if you have swap on the SSD and want to avoid
 unnecessary read/writes, you can reduce swappiness. i have 12GB RAM and i
 think normally i don't really need swap space on disk, so i thought that
 could be a good idea.
 
 so what i'm planning to do now is:
 
 - put swap on the SSD

don't make a swap partition, use a swapfile.

 - reduce swappiness

only swapon if you really need it.

 - put /var/tmp/portage on tmpfs

good, but also put /tmp on tmpfs.

And maybe /var on a harddisk.


-- 
#163933



Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Neil Bothwick
On Sun, 21 Jul 2013 21:39:29 +0200, Volker Armin Hemmann wrote:

  - put /var/tmp/portage on tmpfs  
 
 good, but also put /tmp on tmpfs.

Doesn't the FHS spec say that /var/tmp should survive a reboot? So the
correct approach is to put /tmp on a tmpfs and set  PORTAGE_TMPDIR
to /tmp.


-- 
Neil Bothwick

Mosquito - designed to make houseflies look better.


signature.asc
Description: PGP signature


Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread Volker Armin Hemmann
should - not must have to survive. And nothing in /var/tmp/portage is
important enough. So just let it get lost.

I would not put PORTAGE_TMPDIR to /tmp because if it accidentally fills up,
you have a big problem. While a seperate tmpfs /var/tmp/portage... well
nobody cares if it is full. Yeah, emerge fails but that's it.


2013/7/21 Neil Bothwick n...@digimed.co.uk

 On Sun, 21 Jul 2013 21:39:29 +0200, Volker Armin Hemmann wrote:

   - put /var/tmp/portage on tmpfs
 
  good, but also put /tmp on tmpfs.

 Doesn't the FHS spec say that /var/tmp should survive a reboot? So the
 correct approach is to put /tmp on a tmpfs and set  PORTAGE_TMPDIR
 to /tmp.


 --
 Neil Bothwick

 Mosquito - designed to make houseflies look better.



Re: [gentoo-user] more on SSD: swap

2013-07-21 Thread William Kenworthy
On 21/07/13 22:31, luis jure wrote:
 
 OK, now i have my system successfully installed and running on my new SSD.
 now i have to decide what to do with the rest of the disk (it's a 256MB
 samsung).
 
 the first big question is: what about swap? i found some web pages
 (perhaps old) stating that it's not wise to put swap on the SSD because of
 all the read/writes. but apparently from what i read on the recent
 thread on this list, that shouldn't be much of a concern now. 
 
 i also read somewhere that if you have swap on the SSD and want to avoid
 unnecessary read/writes, you can reduce swappiness. i have 12GB RAM and i
 think normally i don't really need swap space on disk, so i thought that
 could be a good idea.
 
 so what i'm planning to do now is:
 
 - put swap on the SSD 
 - reduce swappiness 
 - put /var/tmp/portage on tmpfs
 
 so, do you guys think that's a good setup?
 

swap: this will make one of the bigger speedups to the system when you
need swap.  swap is good - yes you can do without it, but the day comes
when you REALLY do want it, and ... [crash!] ... otherwise it can just
sit there waiting :)

/etc/sysctl.conf:

#vm.swappiness=1
#vm.vfs_cache_pressure=50

these were recommended to me for running vm's and seem to do the job
(usually I am running with a several GB of swap (16G ram, 16G swap) in
use ... these settings definitely minimise it though big rsync jobs
stall when it fills ram+swap.

/var/tmp/portage is a more difficult one ... a long thread way back
(Dale, I think you were in it) looking at speed showed there was no
speed advantage to compiling in tempfs because spinner) disk caching was
so good the data only hit the disk when necessary.  I presume the same
will apply with compiling and SSD's in that the actual writes will be
minimal (in the scheme of things) so it shouldn't be a worry.  My
experience with compiling in tempfs is that it works, but has a much
higher failure rate than on disk - i.e., things like OO/Lo, KDE, gcc and
glibc have large space requirements that you must make sure tmpfs can
satisfy before you start.  And if its a busy machine actively using lots
of ram it gets hard.  I am making the point that most machines today
are way overprovisioned but when you are near the edge, saying things
like I gave xGB ram and never needed swap, so you wont either is
misrepresenting the situation.

BillK