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

PHP OOM errors when PHPConsole enabled #36

Closed
nhorvath opened this issue Dec 27, 2013 · 7 comments
Closed

PHP OOM errors when PHPConsole enabled #36

nhorvath opened this issue Dec 27, 2013 · 7 comments
Assignees

Comments

@nhorvath
Copy link
Contributor

This is kind of complicated to replicate, and I even took a while to nail down for sure that PHPConsole was causing it it but I will try to explain as best I can.

Initially, PHPConsole will work fine, however after some use (maybe 30 mins of developing, so lots of page refreshes and page loads) the server will start returning 500 errors but most pages will actually load fine. The PHPConsole icon will disappear from the address bar. It must be that the errors occur during the flush handler for PHPConsole. PHP error log shows OOM errors but the strange thing is that the memory limit is set MUCH higher then the number in the error. Once the 500 errors start occurring they continue until cookies are cleared. Then they will go away for a similar period of time as the initial period and then reoccur.

Disabling PHPConsole eliminates this issue.

I've tried increasing the memory limit in php all the way up to absurd numbers but it doesn't help, the reported max in the OOM error message remains the same. PHP is reading the configs I set because ini_get('memory_limit') reflects the values I set it to.

@barbushin
Copy link
Owner

Hi

Thank you for report! Could you please answer on some questions?

What version of PHP you're using?
What framework/CMS?
Do you dump some big strings/objects using PHP Console?
Did you tried to decrease PHP Console headers limit?

@nhorvath
Copy link
Contributor Author

PHP 5.4.5.
Zend Framework 2.2.4
Yes, I do, but my wrapper for it should limit things so objects that strlen(print_r($message, true)) > 10000 don't get dumped.
I was unaware of that setting. What do you recommend?

@barbushin
Copy link
Owner

So I think that a problem is in dumping huge ZF objects. Can you please try to disable any object dumping in PHP Console, use only errors handler. So if in this case 500 error problem will not be reproduced, then I will just check Dumper algorigthm for memory usage optimization.

@nhorvath
Copy link
Contributor Author

So what I had done is added a log writer to zend that basically echoed all
my logs to phpconsole. I disabled that and haven't come across the issue
again today. Do you have any idea why it would "build up" from one request
to another? What I mean is if the issue happens on one request. I can clear
my cookies, log in again and make the exact same request with the same logs
generated and it will be fine, but over time something seems to build up
and then start causing the errors.

Also, just FYI they weren't ZF objects, they were mostly my data objects
that I would get back from webservice requests, so mostly just json_decoded
json.

On Fri, Dec 27, 2013 at 2:27 PM, Sergey notifications@github.com wrote:

So I think that a problem is in dumping huge ZF objects. Can you please
try to disable any object dumping in PHP Console, use only errors handler.
So if in this case 500 error problem will not be reproduced, then I will
just check Dumper algorigthm for memory usage optimization.


Reply to this email directly or view it on GitHubhttps://github.com//issues/36#issuecomment-31276329
.

@barbushin
Copy link
Owner

Hm... I have an idea!

Can you please edit \src\PhpConsole\Connector.php file and change POSTPONE_REQUESTS_LIMIT constant value to 2 or 3 value?

@nhorvath
Copy link
Contributor Author

ok, i've set it to 2. i had already cleared my cookies since the last time
it happened so i will monitor the issue and see if it reoccurs.

On Fri, Dec 27, 2013 at 3:19 PM, Sergey notifications@github.com wrote:

Hm... I have an idea!

Can you please edit \src\PhpConsole\Connector.php file and change
POSTPONE_REQUESTS_LIMIT constant value to 2 or 3 value?


Reply to this email directly or view it on GitHubhttps://github.com//issues/36#issuecomment-31278381
.

@ghost ghost assigned barbushin Jan 3, 2014
barbushin added a commit that referenced this issue Jan 15, 2014
Fixed: headers problem if flush() or ob_end_clean() is called before script shutdown
Fixed: problem with frameworks that overrides $_SESSION handler see https://github.com/barbushin/php-console#troubleshooting-with-_session-handler-overridden-in-some-frameworks
Migration: Update PHP Console extension to last version >= 3.0.20

[Fixes #34]
[Relative #36]
@barbushin
Copy link
Owner

There was some new features commited in release v3.1. Please check if problem is resolved, and if not, reopen issue. Thank you.

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

No branches or pull requests

2 participants