LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Build from source or Via Package Manager (https://www.linuxquestions.org/questions/linux-newbie-8/build-from-source-or-via-package-manager-827836/)

Greedyh4mster 08-22-2010 01:47 PM

Build from source or Via Package Manager
 
Hiya!

I am very new to using Linux system. The distro that I am exposed to right now is Debian Lenny 32bits on a 256MB VPS which I intend to use it to host my personal website and php applications.

I am kinda of an optimization freak (Just love to see those low numbers on memory usages especially). Therefore I stumbled on a question in which I hope you guys could help to lead me towards the correct direction.

Right now, I am stuck on a decision whether to build the web server (Nginx) and PHP from source or installing it via the package manager in this case it would be apt-get.

From what I understand from building application from source, I will need to install the required libraries and gcc usually. Would gcc and the required libraries take up parts of the memory and performance issues (Especially in terms of memory)? As in after I have build the applications from source and rebooted, will those libraries and gcc "hinder" the memory usages or performance?

Pardon me for my weird fetish for memory numbers. =S

GrapefruiTgirl 08-22-2010 02:08 PM

Hi there, welcome to LQ!

Whether you build a particular application from source yourself and install it, or you install it via the package manager, you ultimately end up with pretty much the same thing in the end - that is, the application will be installed. While there are *some* things you can *sometimes* optimize when compiling software on your own machine, rather than installing pre-built binaries, the software will still have the same dependencies in the end. So, you'll need those dependencies (shared libraries) on the system anyways when it comes time to fire up the software; and the dependencies (more specifically, the software application and the dependencies) will consume XXX amount of memory when running. Likewise, whether you compile, or install, your software, it will still consume about the same disk space once it's installed, assuming you remove (delete) the source code for the software after you've compiled it.

As for GCC, well, it gets used to compile the software (and consumes memory while doing so) but once your software is done being compiled & installed, GCC is out of the picture. That is to say, it's still installed, taking up disk space, but it isn't using any memory unless you're compiling something. You could remove GCC after you're done compiling, if you like, to save disk space.

Note: the above are general guidelines; I'm not too familiar with how a VPS is set up - so on a VPS, if merely having stuff installed on your VPS, whether the stuff is running or not (I'm talking disk space), is synonymous with memory consumption on the host machine, then it would seem clear that having less stuff installed, would equal less memory usage of the host machine. But to my understanding, this is not the case - whether a VPS, or a real machine, I would expect software that is not being used (like GCC), to be dormant on a disk somewhere, and not consuming memory anywhere.

I hope I've understood the question well, and that this clears things up for you. :)

Sasha

Greedyh4mster 08-22-2010 02:45 PM

Yup! You have cleared my question beautifully! Thanks to you, I have decided to try and install the applications I need from source. That way, I could be updated with the latest software versions without any dependencies. (One thing I hate about debian which I just realized, the softwares I installed via the package manager are pretty outdated (Especially Nginx). I will have to use other repositories like backports and others in order to keep up to date.)

Quote:

whether a VPS, or a real machine, I would expect software that is not being used (like GCC), to be dormant on a disk somewhere, and not consuming memory anywhere.
I think what you said above is quite right. An installed software that is not running, should not be consuming any memory.

An Offtopic by the way: If I have other questions, do I post a new topic or can I continue from here? Hehe. =D

GrapefruiTgirl 08-22-2010 02:54 PM

Note that on binary-distributed distros, you'll need some basic stuff (not including dependencies you will require) in order to begin building stuff. For example, I don't use Ubuntu (a Debian derivative/relative) but on Ubuntu, if people want to start compiling stuff, you usually begin preparation by doing something like:
Code:

apt-get install build-essential
apt-get install devel

or something like that - which installs header files, the compiler, and things you commonly need before beginning building stuff. You may need to do something similar as preparation.

I don't quite understand this:
Quote:

I have decided to try and install the applications I need from source. That way, I could be updated with the latest software versions without any dependencies.
Sometimes, running the very latest versions of stuff, will require even more newer dependencies; and sometimes not. But whether you build older (stable) software, or newer (even bleeding edge) stuff, you still need the dependencies. Once you begin compiling something, you will discover soon enough if you're missing dependencies. :)

As for your next question, if it relates to this thread/topic, go ahead and ask it here. Otherwise, if this particular question is answered to your satisfaction, you can mark this thread [SOLVED] using the Thread Tools drop-down above your first post above, and open a new thread with your new question, assuming you've looked around a little and haven't found the answer you're looking for ;)

Best regards!
Sasha

Greedyh4mster 08-22-2010 05:21 PM

Quote:

Sometimes, running the very latest versions of stuff, will require even more newer dependencies; and sometimes not. But whether you build older (stable) software, or newer (even bleeding edge) stuff, you still need the dependencies. Once you begin compiling something, you will discover soon enough if you're missing dependencies.
Ahhh! I totally forgot about that. But I guess I can live with the latest version of the softwares though it may come with a price of a heavier memory load (Hopefully the newer versions doesnt add that much load =S).

And by the means of dependencies in my above post, I meant that I need not rely or wait for the others to update the softwares on their repositories. Thus removing the dependency of that.

I guess I will open up a new thread for the other questions. They are not really related to this topic anyway.

Thank you for replying back with such awesome answers that fast!

GrapefruiTgirl 08-22-2010 05:44 PM

Quote:

Originally Posted by Greedyh4mster (Post 4074449)
And by the means of dependencies in my above post, I meant that I need not rely or wait for the others to update the softwares on their repositories. Thus removing the dependency of that.

Yes, that's correct - you can for a while anyways get ahead of the repos as for certain versions of packages or other tools, dependencies, etc. However, you can also sometimes find that a version of something that is too new, will also give you problems! LOL, there's a catch either way.

I tend to try the newest versions of stuff first, and not necessarily wait for my distro to ship the new version. Most times, this works out fine, and otherwise I'd be waiting a long time for this version to ship with my distro.
But, in some cases, the newest-fangled version is too new for too many other packages that depend on it, so a slight downgrade is necessary.

Certain groups of items that are shipped with distros, are all built & tested as a group, with certain versions known to work well together; so you can introduce weirdness if you take one or more parts of the group and make them an extremely different version.

Again, this is something you will discover if/when/as it happens, so if you want to try the most newest stuff, go ahead. :)

Good luck with your project!

Sasha

Greedyh4mster 08-22-2010 11:36 PM

No doubt. Newer versions could introduce several more compatibility issues. What inspired me to start building from source is actually when I am installing the web server (Nginx). The version from the main repository was like 0.6.X whereas the stable version as listed in their website was like 0.7.67. Although they are of 2 different build like one is from the legacy stable and the other the stable build.

I was thinking like since I am hosting for a web, it is critical to have always the latest version from those stable builds. While since it is of the stable build, I can also put my mind to ease since there will be plenty who are running the same version as me; Help should be relatively easy as compared to using those of a legacy build.

And besides building from source will means I can tailor the application to my needs; Enabling or disabling those modules which I dont need. And like you said; I will be able to downgrade or upgrade as and when I like (Although I really need to learn how to downgrade). More control. =D


All times are GMT -5. The time now is 06:32 PM.