Results 1 to 10 of 12
Hey everyone,
I may not be a complete newbie, but I'm fairly close, so bear with me...
I have a 256mb Slicehost account. Previously I was using Ubuntu and LAMP, ...
- 05-17-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 3
How can I get the most out of a 256MB server?
Hey everyone,
I may not be a complete newbie, but I'm fairly close, so bear with me...
I have a 256mb Slicehost account. Previously I was using Ubuntu and LAMP, but I noticed how incredibly high the RAM usage was (there were, like, 20 megabytes free under no load).
I switched the web server to lighttpd and that has made a difference, but what else can I do to make things a little leaner and meaner?
Should I switch to Gentoo? (All of my experience is with Debian and Ubuntu, but from what I've heard, Gentoo is fast so I'd be willing to learn it.)
I need to host some PHP stuff (wordpress, drupal, some symfony apps) and some Python stuff (Django) which I can do just fine right now (Django and PHP through FastCGI). Because of what I have, I think I'm fairly database independent.
Any advice on speeding up / cutting down memory usage would be greatly appreciated. I will switch distros if it will help.
Thanks.
- 05-17-2008 #2
The advantage of Gentoo is that your apps are compiled based on your specific architecture and compile options.
That does speed up the apps ... somewhat.
Gentoo also makes you think about the kernel and talks about customizing it.
You can reduce unwanted drivers/modules by customizing your kernel.
Memory usage on your system is mostly caused by running services.
You should look at those and eliminate any that have no use for you.
Gentoo is very customizable ... but I will warn you that compile times may be long for certain apps ... some people have complained about this point.
The Gentoo Docs and Wiki are extremely helpful.
Men occasionally stumble over the truth,
but most of them pick themselves up
and hurry off as if nothing had happened.
Winston Churchill
... then the Unix-Gods created "man" ...
- 05-17-2008 #3Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
I am not sure what do you mean. If you run the server on the same machine you are running an X session then you are out of luck :P I know no web server that's lighter than lighttpd.
I can only advise to use Gentoo to everyone, and I love it. But if your main reason to change to Gentoo is "speed", then I don't think that that's a valid reason.Should I switch to Gentoo? (All of my experience is with Debian and Ubuntu, but from what I've heard, Gentoo is fast so I'd be willing to learn it.)
Check the output for htop, and see what's sucking up your ram. I doubt that lighttpd is the problem. I would suspect on django (python needs to load a vm, you know...). I'd suggest porting all the django stuff to php if you want to run on the light side.Any advice on speeding up / cutting down memory usage would be greatly appreciated. I will switch distros if it will help.
Not that much. The difference on most apps is really not appreciable. Maybe when encoding video and rendering 3d with blender you will notice some improvement due to sse and all that stuff.
Wich will give you no speed boost at all. It will save you some megabytes in your hard disk, though.Gentoo also makes you think about the kernel and talks about customizing it.
You can reduce unwanted drivers/modules by customizing your kernel.
EDITED: note that, while you will be saving some disk space by ripping things in the kernel, you will also be losing around 300-400 mb of disk space for each installed kernel, because on Gentoo you need to have the souces for the kernel under /usr/src.
Compiling things takes time. People that care about that should be using a binary distro, and shound't be complaining about how long it takes to compile a given thing. It's just like to complain how far Russia is from the U.S.A.: it's just that way, and that will NEVER change.Gentoo is very customizable ... but I will warn you that compile times may be long for certain apps ... some people have complained about this point.
Probably, the best around.The Gentoo Docs and Wiki are extremely helpful.
Cheers.
- 05-17-2008 #4Just Joined!
- Join Date
- May 2008
- Posts
- 3
Looking at the results of "top"... why are there a bunch of php-cgi processes and a bunch of python processes? How many does it need/why does it need to run so many?
Ok, so I guess I won't switch to Gentoo unless I have a desire to learn more...
- 05-17-2008 #5Linux Guru
- Join Date
- Nov 2007
- Location
- Córdoba (Spain)
- Posts
- 1,513
Ask to django

About the cgi, I suppose it depends on your web page. But python is a beast. I don't really understand why would anyone want to use a python based product on a web server. We already have to cope with databases wich a large enough. Let out using a vm product on a server... I suppose that it's a question of tastes... just like masochism
PHP can do anything.
EDITED: Also, note that lighttpd and apache have lots of compile options. The threading model was changeable on apache, I don't remember about lighttpd, but you might want to check that. Anyway, I doubt that the cgi threads are wasting your ram. Compared to a python vm, anything else is moot.
- 05-17-2008 #6
Usually with Apache - and I assume this the same with django - there
are several processes started automatically to cater for
light load. When these are nearly used, more are started.
With Apache, you set how many in the config file. I have
never used django so wouldn't know where to start...
... well maybe Google
If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 05-17-2008 #7
Articles
superuser2 great that you are hosting with Slicehost too, I run Ubuntu on my VPS and
Postfix
VSFTPD
LAMP (Wordpress) for an average of 1000 visitors a day
and more I can't remember
I recommend you go over the Slicehost articles they are a good reference. My set up uses 134MB of RAM. I am also positive Apache and MySQL were responsible for most of the RAM use.Last edited by ls354; 05-17-2008 at 09:05 PM. Reason: txt
- 05-17-2008 #8
Well, are you sure you're not interpreting the amount of memory usage incorrectly? I know when I first started using Linux, I'd look at the output of "free" and think my system as going to crash often, but it would always work well. Later I found out that's just the way Linux handles memory.
In any case, I run several servers on my box with 256 MB...
Apache2, with PHPMod and SSLMod
MySQL
Postfix
BIND
OpenSSH
Just to name a few.

It seems like it sure is using a ton, and in fact there's even a good amount of swap used, but it's running nice and fast.
Of course, it's literally under no load there, but it can handle up to about 5.5 load times before it starts to bog down. Anyway, this isn't to brag, but to suggest you might be just fine with 256 for a server. Though maybe I've just been lucky; I'm sure the actual load probably varies, mine is just a small home server/router.
- 05-18-2008 #9
Agreed, just because memory is in use doesn't mean there is a problem, in fact
it is likely to be the other way around. Linux will use most of the "free" memory
for a variety of buffers and caches. On our Linux server known as Beastie, I
have allocated 1.5 gb of the 3gb ram purely to mysql caches.
It also occurs to me that you may have been better off running PHP with
Apache as a mod rather than fast-cgi. I don't know if your new server can do
that though.If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)
My new blog. It's probably not as good as I think it is.
- 05-18-2008 #10Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044


Reply With Quote
