Will there a difference in performance when a server (httpd or mysql) by building it from sources vs installing it using yum/apt repositories?

Solution 1:

For e. g. http://dev.mysql.com/doc/refman/5.0/en/compile-and-link-options.html to quote:

  • If you link dynamically (without -static), the result is 13% slower on Linux. Note that you still can use a dynamically linked MySQL library for your client applications. It is the server that is most critical for performance.

So, in general answer is "there will".

Solution 2:

The advantages should be minimum unless you're hitting a specific situation where compiler optimizations would help you. My personal opinion is that it's not worth the extra work and, if you're on a support contract for you base OS, it would invalidate it.

As always, I suggest you to carefully benchmark your compiled version and the vanilla package in a controlled environment.