building cmake causes heavy swap use on VPS

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.

Swapping prevents a server from crashing when it's low on memory, but the performance of your virtual machine will be greatly reduced by it and so it's undesirable behavior and a signal something needs to be done about the memory usage of the server.

Because the swapping not only impacts the performance of your own virtual machine, but also those of other customers running on the same physical host we kindly ask you not to ignore this notification and fix this issue as soon as possible. There are two possible solutions to this problem:
  • Reduce the memory usage of the VPS.
  • Increase the RAM memory of the VPS.
Thank you for your attention. If you have any further questions regarding this swap notification, please contact our support desk.
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
 
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...)
 
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?
 
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.
 
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.
 
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.
 
Back
Top