Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have come across several posts talking about light weight distros from a general context, but none of them are really hitting the nail on the head for me.

Specifically, I have PHP script that I run in the background constantly on a virtual server.

My PHP script only uses about 60MB of memory. I potentially need to spin up 50 or so servers to run different variations of the script, although they will have the same memory use.

Currently I am using Virtualbox on a Mac and Ubuntu Server, but stripped down to nothing, for some reason I cannot get it to use less than an average of 1GB of RAM (Ubuntu, via top, not VB). I really would like to get the entire install and top usage under 128M? 256M? What would be a suitable distro to accomplish this?

Mac and VB is probably not the most efficient to run these, so please also suggest alternatives if you think that will help reach the goal.

share|improve this question
    
Probably running a whole VM just to run a variation of a script is overkill. Can't your script take a parameter? I suspect the "traditional methods" of running one program on one host, with parameters or other way to discriminate a task, would be sufficient. –  Keith Oct 21 '12 at 21:25
    
Linux will use as much memory as you have available for disk caching. –  jordanm Oct 21 '12 at 21:49
    
currently each vm install represents a client account, and using a vm has been chosing for more client account management reasons rather than simply for script performance. –  user658182 Oct 21 '12 at 21:49
    
whatever reason for the downvotes, a little constructive feedback would be better than arbitrarily clicking. if you are not willing to help out to begin with, why even be here? –  user658182 Oct 21 '12 at 21:51
    
@jordanm I didn't know that. However, starting with as small as amount as possible 256, 512, it kept going into swap, even though nothing was running. 1gb was as small as I could make it for it to run more smoothly. –  user658182 Oct 21 '12 at 21:57
show 2 more comments

2 Answers 2

up vote 1 down vote accepted

Try Alpine Linux, which will be substantially smaller than Arch. It uses BusyBox/uClibc, but is nonetheless a full-featured distribution. The downside compared to Arch is the community is much smaller, so the wiki is thinner, and so on. But if you know what you're doing, how to find your way around a new distro, and so on, then this is a really nice one. There are other barebones/minimalist distros, such as TinyCore Linux, SliTaZ, Damn Small Linux, Puppy Linux; Alpine is what scratches my particular itches best.

That said, as the downvotes you've gotten so far suggest, this question probably isn't the best fit for unix.SE. And as Alex Chamberlain says, you're likely to get better returns from rewriting your script so that you don't need a different virtual machine for each one.

share|improve this answer
    
Thank you for the feedback. Researching alpine and arch now. Any thoughts on which may be best in a VM environment? Does that even matter? Would an install have different performances based on it being a primary OS or a VM? –  user658182 Oct 21 '12 at 22:06
    
I've used both. Alpine is much lighter-weight; with Arch there will be more people who can help you out, and you won't have issues about lacking Gnu's libc or coreutils. I think those are the main factors in the decision between them. Using as VM should be fine either way. –  dubiousjim Oct 21 '12 at 22:08
    
Thanks also about the feedback on the downvotes. The home page welcome block for this QA site says, "This is a collaboratively edited question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.." .. thus, the reason I chose it. Perhaps throwing PHP into the mix made it a little confusing, I was just trying to provide background as to why. If this is not the best place to ask which linux distro is best for a VM environment, please let me know which other QA site would be better. thanks. –  user658182 Oct 21 '12 at 22:09
    
I think it's just that most forums these days aren't hospitable to "what's the best distro/editor/webserver/etc" questions. –  dubiousjim Oct 21 '12 at 22:11
add comment

Answering the question as written... Try Arch Linux; it allows you to install the bare necessities and build up from there.

However, if you need to run the script on a low memory system, I would start by rewriting it in another language. Ideally, C/C++, but I'd give Python a go too. Furthermore, I'd design it in such a way that I can run multiple copies of the same script with different parameters on the same machine.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.