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

Only seems to work with a single thread #148

Closed
tpavlek opened this issue Oct 20, 2020 · 4 comments
Closed

Only seems to work with a single thread #148

tpavlek opened this issue Oct 20, 2020 · 4 comments

Comments

@tpavlek
Copy link

tpavlek commented Oct 20, 2020

After a pretty frustrating series of issues, I've settled on the problem that valet appears to only allow a single thread to execute at once.

You can replicate this by having two apps on your machine and just doing something like a sleep(20) in one of them, and then try to load the second. The second's request will not complete until the end of the sleep call on the first.

This is a dealbreaker for apps that need to communicate with each other because obviously an app in the process of responding to a request cannot make an http request to another app if both are blocked by the same thread.

I could not find anywhere to configure adding additional nginx/fpm threads. Ideas?

@tpavlek
Copy link
Author

tpavlek commented Oct 20, 2020

So a resolution to this is simply to set the PHP_FCGI_CHILDREN environment variable to something higher than one. The variable is respected on PHP versions 7.1 and higher.

I know nothing about windows services and I couldn't figure out how to set one with valet so I can't commit a pull here, but if anyone else is having a similar problem as a patch I simply stopped the valet_phpfpm service, and then set an environment variable in a console and ran C:\php\php-cgi.exe on port 9001.

Hopefully we can get a fix in this package!

@cretueusebiu
Copy link
Owner

@tpavlek You can add <env name="PHP_FCGI_CHILDREN" value="10"/> in ~/.config/valet/Services/phpfpmservice.xml and then run valet restart.

I'll add it by default.

@tomcrofty
Copy link

Sorry to bring up an old issue but where would I find phpfpmservice.xml, its not in the valet-windows folder within composer.

@cretueusebiu
Copy link
Owner

@tomcrofty You can find it in ~/.config/valet/Services and it has been renamed to phpcgiservice.xml in the latest release.

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

3 participants