# building cmake causes heavy swap use on VPS



## cbrace (Apr 10, 2013)

Hi all,

I am in the process of setting up a VPS for testing purposes, and I chose minimal resources: single CPU with 256 MB memory. I installed FreeBSD 9.1 64-bit.

A short while ago I started building databases/mysql55-server, which has among other things devel/cmake as a dependency. That takes a long time to compile. Just now I received an automated warning from the hosting company that my VPS was swapping too much: 





> This is an automated notification that your virtual machine with the name '*****' has been swapping considerably during the past hour.
> 
> If a virtual machine is swapping this is an indication that there's not enough memory available to process all tasks running on the VPS. If the RAM of the VPS fills up the operating system on your VPS will free up some memory by writing parts of memory to disk.
> 
> ...


Is 256 MB too little memory to compile something like cmake?

Is there something specific to compiling cmake which is particularly RAM- or disk-intensive?

TIA


----------



## jb_fvwm2 (Apr 11, 2013)

Short answer, yes.  cmake, for instance, when the p4 box which just broke here was still in use, I'd be careful to not be in an xterm, but at the console. (Not many, but a sizeable number of ports if one has thousands installed...)


----------



## cbrace (Apr 11, 2013)

I suppose one could just install everything via packages instead of ports. In the past, I've encountered dependency problems installing packages, probably because I had already installed some ports, and the packages tend, in my experience, to lag a few minor versions behind. 

Has anyone here ever built a server solely from packages?


----------



## SirDice (Apr 12, 2013)

Yes, I do. But I also build my own packages at home using PKGNG. I have a simple jail I use to build my packages, I've exported them with a web server. Now on my VPS I can simply point PACKAGESITE to my home server and run `# pkg upgrade`. 

And because I build everything myself I can, for example, build a PHP5 package _with_ the Apache module. I can also keep track of dependencies while I'm building them at home without ever having to touch the files on my VPS.


----------



## kpa (Apr 12, 2013)

I do the same now, I build my own packages using ports-mgmt/poudriere-devel and I install the packages with `# pkg install` using the local packages directory as the "remote repository". Gives me full control of the options and I don't have to worry about extraneous packages on the real host since the build only dependencies will stay in the jail and get automatically deleted when the build run is finished.


----------



## cbrace (Apr 30, 2013)

I'm tempted henceforth keep this server updated via the package system. One question: I've read that packages for RELEASE are only updated for security fixes, not for bugfixes or enhancements, and that maintaining a system at STABLE is the better way to go. How then to you manage base updates? From what I understand, you cannot use `freebsd-update` to upgrade a system from STABLE, it only works for RELEASE.


----------

