Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.1.0 takes a very long time to render errors #401

Closed
patroniton opened this issue Mar 14, 2016 · 14 comments
Closed

Version 2.1.0 takes a very long time to render errors #401

patroniton opened this issue Mar 14, 2016 · 14 comments

Comments

@patroniton
Copy link

I'm using Laravel 5.2 and when I call return parent::render($request, $e); in the render method in App\Exceptions\Handler.php it takes a very long time (2-3 minutes) to display the error page. My CPU usage also spikes to 70-80% while it's running.

I'm also using Graham's Laravel Exceptions package here.

If I catch my own exception or return from the method without calling return parent::render($request, $e); then the page renders as expected.

This doesn't happen in version 2.0.0, so for now I'm going to keep using that. If you need any more information from me on this issue I'll try my best to provide you with it.

@GrahamCampbell
Copy link
Contributor

I assume this is because whoops 2.1 is trying to dump some heavy ass objects, and that's taking ages.

@pelim
Copy link

pelim commented Mar 16, 2016

same issue 100% cpu

@staabm
Copy link
Contributor

staabm commented Mar 16, 2016

could someone create a blackfire.io profile for such a slow case and share it here?

@denis-sokolov
Copy link
Collaborator

@jonasdt, would you please take a look at this, and whether it is related to #387?

@jonasdt
Copy link
Contributor

jonasdt commented Mar 16, 2016

Check #396, for Laravel you can use something like

$handler = new PrettyPageHandler();
$handler->setApplicationNamespaces(['App\\']);

It probably makes sense to disable dumping arguments by default.

@GrahamCampbell
Copy link
Contributor

for Laravel you can use something like

That only works if you dump all your code in your application, but does not work if you have a heavily componentized system.

@GrahamCampbell
Copy link
Contributor

It probably makes sense to disable dumping arguments by default.

Agreed.

@jonasdt
Copy link
Contributor

jonasdt commented Mar 16, 2016

That only works if you dump all your code in your application, but does not work if you have a heavily componentized system.

If you don't have a common namespace, then you can do something like

$handler->setApplicationNamespaces(['Component1\\', 'Component2\\', 'Component3\\', ...]);

@jonasdt
Copy link
Contributor

jonasdt commented Mar 16, 2016

Instead of disabling dumping of arguments entirely, we can also cut all internals of the dumped objects (i.e. only show the classname) by default.

@patroniton and @pelim
Can you try my pull request #402? You can include the following lines in your composer.json file, and then run composer update

    "repositories": [{
        "type": "vcs",
        "url": "https://github.com/jonasdt/whoops"
    }],
    "require": {
        "filp/whoops": "dev-cut-internals"
    },

I've tried it for some of my Laravel projects and performance is fine.

@rossbearman
Copy link

@jonasdt, your later pull request, #404, makes a dramatic improvement for me, using Whoops in Laravel 5.2. The average load time for the Whoops handler has gone from hovering at around the one minute mark to less than a second.

Without this change Whoops 2 is unusable for me and Whoops 1 doesn't work with PHP 7, so thanks for resolving that.

@denis-sokolov
Copy link
Collaborator

Closed via #404. Will release soon.

@rossbearman, thank you for testing it.

@vaites
Copy link

vaites commented Aug 28, 2017

I had this problem using PHP-FPM on Mac OS X, but works well with mod_php. Don't know if is caused by my configuration but switching to mod_php on my work machine solved the problem.

@staabm
Copy link
Contributor

staabm commented Aug 28, 2017

please provide a blackfire (or similar) profiling result in case you are running out of memory/time

@vaites
Copy link

vaites commented Nov 11, 2017

@staabm, sorry for the delay. I was using a compiled version of PHP on Mac OS X 10.12. I had some strange segfaults so I discarded this installation method in favor of Homebrew and the problem dissapeared. Don't know what was the problem, but I think that maybe is related with those segfaults.

Anyway, I tried to get some profiling but I can't because of the segfaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants