Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page How can I get the most out of a 256MB server?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Reply
 
Thread Tools Display Modes
Old 05-17-2008   #1 (permalink)
Just 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.
superuser2 is offline   Reply With Quote
Old 05-17-2008   #2 (permalink)
Linux Newbie
 
dxqcanada's Avatar
 
Join Date: Sep 2006
Posts: 132
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" ...
dxqcanada is offline   Reply With Quote
Old 05-17-2008   #3 (permalink)
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,158
Quote:
Originally Posted by superuser2 View Post
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?
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.

Quote:
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 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.

Quote:
Any advice on speeding up / cutting down memory usage would be greatly appreciated. I will switch distros if it will help.
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.

Quote:
Originally Posted by dxqcanada View Post
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.
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.

Quote:
Gentoo also makes you think about the kernel and talks about customizing it.
You can reduce unwanted drivers/modules by customizing your kernel.
Wich will give you no speed boost at all. It will save you some megabytes in your hard disk, though.

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.

Quote:
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.
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.

Quote:
The Gentoo Docs and Wiki are extremely helpful.
Probably, the best around.

Cheers.
i92guboj is offline   Reply With Quote
Old 05-17-2008   #4 (permalink)
Just 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...
superuser2 is offline   Reply With Quote
Old 05-17-2008   #5 (permalink)
Linux Engineer
 
Join Date: Nov 2007
Location: Córdoba (Spain)
Posts: 1,158
Quote:
Originally Posted by superuser2 View Post
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?
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.
i92guboj is offline   Reply With Quote
Old 05-17-2008   #6 (permalink)
Linux Enthusiast
 
elija's Avatar
 
Join Date: Jul 2004
Location: This week I am mostly using Workbench
Posts: 568
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
__________________
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
(How much wood would a woodchuck chuck if a woodchuck could chuck wood)

Registered Linux User: #459086

PM is not a good way to get help. Please ask in the forums.
elija is offline   Reply With Quote
Old 05-17-2008   #7 (permalink)
Just Joined!
 
ls354's Avatar
 
Join Date: May 2006
Location: Cloud 9
Posts: 93
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.
__________________
Formulate the right question

__________________________________________________ ________
My server runs on Cheese

Last edited by ls354; 05-17-2008 at 09:05 PM. Reason: txt
ls354 is offline   Reply With Quote
Old 05-17-2008   #8 (permalink)
Linux Newbie
 
SagaciousKJB's Avatar
 
Join Date: Aug 2007
Location: Yakima, WA
Posts: 108
Send a message via AIM to SagaciousKJB Send a message via MSN to SagaciousKJB
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.
SagaciousKJB is offline   Reply With Quote
Old 05-18-2008   #9 (permalink)
Linux Enthusiast
 
elija's Avatar
 
Join Date: Jul 2004
Location: This week I am mostly using Workbench
Posts: 568
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.
__________________
Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
(How much wood would a woodchuck chuck if a woodchuck could chuck wood)

Registered Linux User: #459086

PM is not a good way to get help. Please ask in the forums.
elija is offline   Reply With Quote
Old 05-18-2008   #10 (permalink)
scm
Linux Engineer
 
Join Date: Feb 2005
Posts: 1,003
Quote:
Originally Posted by i92guboj View Post
Which will give you no speed boost at all. It will save you some megabytes in your hard disk, though.
If you're reducing the size of the kernel, that'll free RAM, and if it's RAM you're short on, reducing paging will surely speed things up.
scm is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
 

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 02:08 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0