Re: [gentoo-user] Installing Gentoo on a VPS with little RAM

2016-12-27 Thread Mick
On Tuesday 27 Dec 2016 07:13:36 J. Roeleveld wrote:
> On Monday, December 26, 2016 09:45:47 PM Francesco Turco wrote:
> > Hello.
> > 
> > I have a Vultr VPS instance with Arch Linux but I'd like to replace it
> > with Gentoo Linux. The last time I tried that I couldn't build some
> > packages because the kernel killed gcc after a while. Please notice this
> > VPS instance has only 768 MiB of RAM. What can I try besides removing
> > -pipe from C(XX)FLAGS and setting MAKEOPTS to -j1? Should I add a swap
> > partition? Currently there's only a single root btrfs filesystem with @,
> > @boot and @home subvolumes. Btrfs doesn't support a swap file as far as
> > I know.
> > 
> > My VPS is currently used for the following things:
> > - Static personal website
> > - Shaarli (PHP application with no database)
> > - Tiny Tiny RSS (PHP application with database)
> > - ZNC server
> > 
> > Thanks.
> 
> You could try building all packages on your own system and then installing
> using "-k".
> That should avoid any out-of-memory issues.
> 
> --
> Joost

Many packages require a lot of memory these days to compile, gcc being one of 
them.  With only 768 MiB of RAM you will *definitely* need a swap 
file/partition.   In addition, with so little memory you won't be able to 
compile packages in tmpfs.  Thrashing of your disks will go off scale as the 
machine will try to swap memory to disk and back again.

For these reasons what Joost suggests is the best way.  You could try to share 
/usr/portage via NFS, but since this is a remote server I am not sure the 
security model will be adequate for most use cases.  It would be easier to 
copy your VPS filesystem over to your local machine which is not resouce 
constrained, chroot into it and then sync portage and emerge everything you 
need with --buildpckg.  Then copy over the binary packages to the VPS and 
emerge them there with --usepkg or --usepkgonly.  If you are disk space 
constrained on the server, you don't have to copy over the binary packages 
manually each time.  Instead you can set up your home PC as a binary host and 
serve the binary packages over ssh or over http/s to the VPS client.

Essentially, you will be creating your own bespoke binary distribution on your 
home PC, then downloading it and installing it at your VPS.  Have a look here 
for some pointers:

https://wiki.gentoo.org/wiki/Binary_package_guide

-- 
Regards,
Mick

signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-user] Installing Gentoo on a VPS with little RAM

2016-12-26 Thread J. Roeleveld
On Monday, December 26, 2016 09:45:47 PM Francesco Turco wrote:
> Hello.
> 
> I have a Vultr VPS instance with Arch Linux but I'd like to replace it
> with Gentoo Linux. The last time I tried that I couldn't build some
> packages because the kernel killed gcc after a while. Please notice this
> VPS instance has only 768 MiB of RAM. What can I try besides removing
> -pipe from C(XX)FLAGS and setting MAKEOPTS to -j1? Should I add a swap
> partition? Currently there's only a single root btrfs filesystem with @,
> @boot and @home subvolumes. Btrfs doesn't support a swap file as far as
> I know.
> 
> My VPS is currently used for the following things:
> - Static personal website
> - Shaarli (PHP application with no database)
> - Tiny Tiny RSS (PHP application with database)
> - ZNC server
> 
> Thanks.

You could try building all packages on your own system and then installing 
using "-k".
That should avoid any out-of-memory issues.

--
Joost



Re: [gentoo-user] Installing Gentoo on a VPS with little RAM

2016-12-26 Thread Bill Kenworthy
On 27/12/16 07:15, taii...@gmx.com wrote:
> On 12/26/2016 03:45 PM, Francesco Turco wrote:
> 
>> Hello.
>>
>> I have a Vultr VPS instance with Arch Linux but I'd like to replace it
>> with Gentoo Linux. The last time I tried that I couldn't build some
>> packages because the kernel killed gcc after a while. Please notice this
>> VPS instance has only 768 MiB of RAM. What can I try besides removing
>> -pipe from C(XX)FLAGS and setting MAKEOPTS to -j1? Should I add a swap
>> partition? Currently there's only a single root btrfs filesystem with @,
>> @boot and @home subvolumes. Btrfs doesn't support a swap file as far as
>> I know.
>>
>> My VPS is currently used for the following things:
>> - Static personal website
>> - Shaarli (PHP application with no database)
>> - Tiny Tiny RSS (PHP application with database)
>> - ZNC server
>>
>> Thanks.
>>
> How about do a distributed compile via an SSH tunnel?
> 

I recently built gcc, glibc etc on a raspberry pi model B (arm, 32G sd
card, 512M ram, 1G swap)

Used swap, ccache, distcc to a VM setup to cross-compile, -j1 and made
sure it was otherwise lightly loaded.

For a temp swap if limited by btrfs, FAQ's suggest swap over nfs (I have
used this at times and it can be flakey/hard to get to work consistently
- diskless intel atoms) or via a loopback.

BillK





Re: [gentoo-user] Installing Gentoo on a VPS with little RAM

2016-12-26 Thread taii...@gmx.com

On 12/26/2016 03:45 PM, Francesco Turco wrote:


Hello.

I have a Vultr VPS instance with Arch Linux but I'd like to replace it
with Gentoo Linux. The last time I tried that I couldn't build some
packages because the kernel killed gcc after a while. Please notice this
VPS instance has only 768 MiB of RAM. What can I try besides removing
-pipe from C(XX)FLAGS and setting MAKEOPTS to -j1? Should I add a swap
partition? Currently there's only a single root btrfs filesystem with @,
@boot and @home subvolumes. Btrfs doesn't support a swap file as far as
I know.

My VPS is currently used for the following things:
- Static personal website
- Shaarli (PHP application with no database)
- Tiny Tiny RSS (PHP application with database)
- ZNC server

Thanks.


How about do a distributed compile via an SSH tunnel?



Re: [gentoo-user] Installing Gentoo on a VPS with little RAM

2016-12-26 Thread lee
Francesco Turco  writes:

> Hello.
>
> I have a Vultr VPS instance with Arch Linux but I'd like to replace it
> with Gentoo Linux. The last time I tried that I couldn't build some
> packages because the kernel killed gcc after a while. Please notice this
> VPS instance has only 768 MiB of RAM. What can I try besides removing
> -pipe from C(XX)FLAGS and setting MAKEOPTS to -j1? Should I add a swap
> partition? Currently there's only a single root btrfs filesystem with @,
> @boot and @home subvolumes. Btrfs doesn't support a swap file as far as
> I know.

You could verify if it really does run out of memory.  If that happens,
adding a swap file or a swap partition or more memory might help.

> My VPS is currently used for the following things:
> - Static personal website
> - Shaarli (PHP application with no database)
> - Tiny Tiny RSS (PHP application with database)
> - ZNC server
>
> Thanks.



[gentoo-user] Installing Gentoo on a VPS with little RAM

2016-12-26 Thread Francesco Turco
Hello.

I have a Vultr VPS instance with Arch Linux but I'd like to replace it
with Gentoo Linux. The last time I tried that I couldn't build some
packages because the kernel killed gcc after a while. Please notice this
VPS instance has only 768 MiB of RAM. What can I try besides removing
-pipe from C(XX)FLAGS and setting MAKEOPTS to -j1? Should I add a swap
partition? Currently there's only a single root btrfs filesystem with @,
@boot and @home subvolumes. Btrfs doesn't support a swap file as far as
I know.

My VPS is currently used for the following things:
- Static personal website
- Shaarli (PHP application with no database)
- Tiny Tiny RSS (PHP application with database)
- ZNC server

Thanks.

-- 
https://www.fturco.net/