omega8cc / boa

Barracuda Octopus Aegir 5.4.0
https://omega8.cc/compare
394 stars 75 forks source link

Install xdebug as an option #478

Open mrconnerton opened 9 years ago

mrconnerton commented 9 years ago

Would be great if we could have xdebug install as an optional Barracuda config. I am building manually per #15 for now.

arttus commented 9 years ago

I'd plus 1 that, using the instructions on https://github.com/omega8cc/boa/issues/15 doesn't actually work for me.

ar-jan commented 9 years ago

Agree that something like this would be useful as an optional feature.

I've only used XHprof for profiling. I understand xdebug and xhprof don't work exactly the same, but at least for performance profiling xhprof seems the better and more popular choice these days, I think?

What would be really cool is a setting allowing you to sample e.g. 1 in a 1000 page loads, so you can even get some insight into production data without any significant extra load.

macmladen commented 9 years ago

It is not the choice between Xdebug and HXprof, they serve different purposes but are both about development and performance.

They are not needed on live, production server configuration but as there are development platforms, maybe they could be integrated into specific nginx profile for development that should be active for development platforms?

arttus commented 9 years ago

There are plenty of flags that are configurable in the standard BOA installer but perhaps a setting in the BOND tuner script or only when BOA is running in local or up-head would make more sense?

macmladen commented 9 years ago

I don't think so because, as I said, there are dev platforms therefore Aegir seems development friendly so it should not be specific to local. Further more, up-head is testing version of next generation BOA, not the sites themselves, so it does not seem relevant.

I am not sure how much Xdebug and HXprof add to memory footprint and performance if included all the time although passive, but if they do add (and it may be security issue as well) then I'd suggest different setup that is by default bind to dev versions of platforms, Pressflow and Drupal.

That may be controlled the way different PHP versions are included or perhaps inside BOA ctrl files mechanism. It may be interesting for some to use HXprof on live sites to see bottlenecks while I suspect there is any point in having Xdebug available to live.

I've never used remote or live site to do any of those, but this may be interesting.

BrianGilbert commented 9 years ago

I was able to do this using the following (may help for when you come to adding it as an option):

# Install XDebug
echo "Installing XDebug..."
cd /opt
wget -U iCab http://xdebug.org/files/xdebug-2.3.2.tgz &> /dev/null
tar -xzf xdebug-2.3.2.tgz
cd xdebug-2.3.2
/opt/php55/bin/phpize
sh ./configure --with-php-config=/opt/php55/bin/php-config
make
make install

# Add xdebug config to php.ini
echo '
; Xdebug
zend_extension="/opt/php55/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9994

' >> /opt/php55/etc/php55.ini

# Clean up setup files
rm -fr xdebug-2.3.2*

# Install XDebug
echo "Installing XHProf..."
/opt/php55/bin/pecl install xhprof-beta

# Add xdebug config to php.ini
echo '
; XHProf
extension="/opt/php55/lib/php/extensions/no-debug-non-zts-20121212/xhprof.so"

' >> /opt/php55/etc/php55.ini

service php55-fpm reload
bserem commented 8 years ago

I believe that xhprof should be seperated from xdebug. So, @BrianGilbert script should be split in two. The reason is that one might want to have xhprof on a production environment, but I doubt anybody would want xdebug there.

Just an opinion

macmladen commented 8 years ago

It is quite hard to be one size fits all and I am not talking about different people tastes and habits but about different purposes of the BOA stack.

One can always argue about benefits and potential pitfalls, but I think we should be clear here about what is the main BOA aim. I think it is production server and as such I would even question if any of the two, xdebugand xhprof should be on production server (@omega8cc, opinion?).

Any technology that does not benefit to the production adds to the complexity and that adds to potential problems. Some of us are a bit playing (myself too) as I do not have serious clients that would penalize me for security or performance problems. Sometime they won't notice even server being down! However, that is not a kind of approach that should be about BOA.

So one must be completely aware that enabling xdebug or xhprof could penalize performance, memory footprint and may raise demands for resources. BOA as such can work to some extend on 1 CPU / 1GB virtual server but without solr and for not demanding sites. xdebugand xhprof could not really work in such constraints and I am really not sure how would some serious profiling or xdebuging affect production sites.

But BOA is for conscious people who knows what are they doing, so... maybe there could be some option that could enable someone to test and profile how would site operate under BOA in close to real life situation.

Personally, I would not recommend playing with debuging or profiling on production server but I think it could be handy to have those options for some testing VPS instance where one could test how site will perform.

bserem commented 8 years ago

I was under the idea that profiling can happen on production, because it doesn't too big of a footprint. That was the reason xhprof was created in the first place as far as I know. Debuggin is another story and I agree with you.

Also, having the option to install the profiler, doesn't do any harm. I believe having the profiler installed doesn't do much hard if drupal doesn't talk to it. Truth is that with the information on this issue, one can easily add debug/profile capabilities on his system, without any problems. So, even if this is out BOAs scope, we still get the option.

irrelevant ps: I'm also trying to figure out thing with uprofiler, instead of xhprof

mrconnerton commented 8 years ago

I agree about the issues of one size fits all however with that said my original request was "If we could have xdebug install as an optional Barracuda config." I don't want this installed by default but it should certainly be an option.

At the end of the day it doesn't matter if this is in BOA core or not, as long as we have a central place to document how to do it manually. I use BOA as my production servers but I also have servers I use for dev and staging. I even have a local vbox install of boa for local dev. While teaching BOA at conferences this past year I have seen people ONLY using it for dev and staging and using leaner dedicated servers for production.

mrconnerton commented 8 years ago

With all that said there is zero harm and plenty of value putting these as optional flags for install in boa.

bserem commented 8 years ago

XHProf from Pecl crashed with PHP 5.6 and 7.0

Tideways (their opensource fork of xhprof) says to support it.