-
Notifications
You must be signed in to change notification settings - Fork 210
Some operations cause Valet+ to hang completely #49
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
Comments
This happens now every time Drupal has to create new images based on image styles. When I change the image style and load the page, php hangs when trying to create the new images. I have to go to the image link directly to get the image to be created. After they are created, the page loads find and quick. Not sure if this is because these scripts are executed multiple times at the same time. |
@SanderAtom This also occurs on Magento 2 installations, so it's not a Drupal only issue. |
Ye but less often than certain drupal actions. Also only restarting php resolves this issue, restarting nginx has no effect. |
@Tristan-N do you have anymore information about what kind of actions cause this complete crash for you in Magento2? |
I see this in
etc, etc.. Whatever I keep raising, the other settings will max out again. So if I raise It seems specifically bad when there are a ton of requests, like unmerged css/js + image files etc when those calls might have to generate files as well. I kept raising the numbers, now it reads:
I get rid of the warnings in php-fpm.log but it'll still break at some point without any error and give 504's until php is restarted. |
@SanderAtom I don't have real examples. The problem is I am not sure what is happening. When I, for example, want to create a backup from the backend (instead of CLI) it takes up to like 20 seconds before getting the 504 time-out. However, when I just keep waiting suddenly a backup-file is created in the folder it should be. So it seems the processes are still running but 504 is shown in browser. Funny enough, I don't have anything in the errlogs either. |
Ok, but when you get this 504, can you still open other pages? Or you have to restart php before you can do anything on the website? |
I do have to restart php to be able to open pages again (I use |
Using higher numbers for children and start/min/max servers does lower the rate at which php crashes, but I keep getting warnings to increase them. Are there related settings we can try, something like buffer size or something? |
I see this in php.log, not sure if it's related..
|
@SanderAtom and all. Noticed same behaviour (504 gateway timeouts, on pages doing a lot of requests) when installing Cause: Opcache conflicts with APC(U) which causes PHP-FPM children to stay open after a request. Which eventually causes your machine to run out of resources, one way or another. In Change:
To:
End Result:
Then restart your PHP service. But to be sure, just restart everything: NOTE: Fully uninstalling the APC PHP extension breaks Valet so no need to try that. Instead disable APC following the instructions above. |
@Neodork thanks for that information, I'll look into it. A quick scan reveals this thread about PHP-FPM crashing or processes lingering due to APCu turned on, so that seems promising. Although I do remember turning off features before, including APCu, without any direct improvements but I can't say for sure. I might setup a test situation where this crashing occures, without a full webshop system and all the caching layers around it, and see if simply turning off APCu solves the problem. |
I'm fairly certain this is the bug we are experiencing. Since turning off APCu 2 weeks ago, I have not had any php-fpm/socket etc hanging like it would before. |
@SanderAtom Thanks for getting back to this. Since you're confirming this solves the problem I will continue to PR this today. Thanks! |
Well just turning it off isn't really a fix for the problem. Do you have more information about this conflict between OPcache and APCu? Is it something other people are working on and we can add the fix for it later? |
I agree that we should look deeper into the problem. After searching I did not come up with any obvious conflict reports. I can see the need for APCu and OPCache if the two can operate in harmony. Since APC is deprecated in PHP 5.6+ and replaced with APCu and OPCache. As far as the difference go:
Although I haven't done a lot of research I did find an article mentioning that the v4 of APCu is not compatible with PHP 7 or higher. Doing a quick search in the code however reveals that APCu is installed according to the PHP version so it shouldn't be a version conflict either. However I haven't actually checked if the correct package is linked when switching PHP versions.
The above code will Edited: Code does run links if installed. |
I don't know if this is related, but I'm also struggling with Magento 2 and valet+ (and the original valet for that matter) hanging completely. When I visit a site for the first time some of the static content (css, js, images etc) will start to load, but then everything will start 504ing. If I then try to reload the page I just get a 504 gateway timeout message on the page. I can also see that even though the page has stopped loading the php-fpm process is still running at well over 200%. It's not until I restart php that the cpu usage drops. I can then reload the page again, but at some point the static content starts 504ing, and we're back where we started... I tried the fix by @Neodork to disable APC, but it doesn't seem to have had any effect. |
Looking into this a bit more I discovered there is an additional file that takes precedence over the settings in So if you set That issue solved, I now have to figure out some other stuff (now all my static assets are 502ing rather than 504ing) - it doesn't matter how easy/simple tools like valet purport to be, nothing is ever straightforward... ;) |
--- weprovide#49 should be resolved with the new homebrew/core php management.
Hi, I was getting errors with APCu after switching the PHP version from 7.0 to 7.1 with |
Or just fucking delete the entire z-performance.ini from php folder... would've save me 3h of my life... it not more... Thanks for the solutions any way. Deleting the file worked for me 🥇 👍 |
This appears to still be causing issues with normal use.
Was this supposed to have a resolution? if not why are there still apcu fetch and add calls in the server.php if it isn't enabled? |
Dear Contributor, With the release of Valet+ We're closing this ticket because it does not follow the correct format. If you feel your ticket is still relevant we encourage you to re-open your ticket using the correct format. Kind regards, |
@Neodork this issue is still in use, see the link on https://github.com/weprovide/valet-plus/wiki/Drivers |
It's hard to pinpoint what is going on, but after certain actions involving Ajax calls (I think), Valet+ becomes completely unresponsive. There is minor php-fpm usage when I open a page, but very short then nothing and eventually it times out with a 504 Gateway Timeout.
Very rarely it started working again after a few minutes without doing anything. Mostly I have to restart php and it works again. Sometimes it hangs again on the same Ajax call immediately after, but mostly the Ajax call is handled quickly and without problems after restarting php. Until I open some other pages, save something and try the Ajax call again, it breaks. This happens with a Drupal 8 project.
~/.valet/Log/nginx-error.log
:Nothing in
~/.valet/Log/php.log
I see this in
/var/log/system.log
, but I think it's just a warning because php is always running:Does anyone have any idea which php/nginx settings I can try to solve this?
The text was updated successfully, but these errors were encountered: