So I'm sitting here debating whether or not to just apt-get install
Apache2 and MySQL or spend a day compiling them from source. My main motivation for compiling would be to improve performance. Another motivation would be to circumvent the "Debian way," but I guess I can live with it if I must.
My websites are moderately busy, but nothing too crazy. VPS hosting.
So in your experience, is there a noticeable performance gain from compiling from source or would I be spinning my wheels?
P.S. I already compiled PHP from source because I didn't like the "Debian way."
No, I have not noticed any appreciable performance gains that way. Much more performance is gained the usual way: profiling, refactoring for speed, caching and the other usual tricks.
Most people here will advise you to stick with the packages supplied by your distro. This is because you get the benefit of patches/bug fixes and compatibility/dependency management.
If you roll your own then you have to take responsibility for all of these issues and you loose herd immunity. We see lots of questions from people who have stepped outside of their distro's packange management system and have ended up in a complete mess.
Stick with the Debian way (in some ways) You know it makes sense.
Unless you have some very specific need, don't bother.
Don't underestimate what you get for free using the OS packages:
You're more likely to get big performance gains from tuning the stack you have. E.g.,
Should you roll your own?
The usual answer is: NO.
Where do performance gains come from?
Algorithms and stack structure set the maximum attainable performance, while tuning helps you get to that maximum under your local load etc. conditions. To get better algorithms, you have to become a developer - and it takes a lot of time and effort.
Note that compiling doesn't figure in this list (unless you are meddling with configure options - which sometimes makes sense - and even then rolling the
.deb
file trumps the straightforward old-fashioned tarballing-making-make installing).When does compiling from the source make sense?
Here I assume that you use Debian's packaging system (including such goodies as fpm), otherwise you are in for a bloodletting down the line.
A word of caution: fiddling with MySQL for performance is not worth it. Install (or even buy and install) a better RDBMS instead.
My 2 cents, anyway.