Comments (13)
@Bilge Don't worry, @pcrov was kind enough to provide a profile: https://blackfire.io/profiles/ac370ddb-e112-4941-bfe5-bb8171c968cc/graph
from process.
The number of concurrent requests shouldn't affect this, nor should the size of the responses. Another process should only be used for reading the hosts file on Windows and for reading several registry entries for the DNS configuration.
from process.
The number of concurrent requests shouldn't affect this
I'm sure you're correct, but empirically you're wrong. If $limit
is the upper bound of the range()
then I can tell you I've clearly observed that:
- For
1 < $limit < 10
the code never times out - For
50 < $limit < 200
the code sometimes times out - For
$limit === 1000
the code always times out
So whether it betrays your expectations or not, the number of concurrent requests directly affects this. Moreover, changing the timeout from one second to 30 seconds, as in the linked PR, causes all three cases to pass without timeout errors.
from process.
I'm just referring to what the code should do, not what it will do. I didn't say I'm sure it's bug-free. It can totally be that too many processes are spawned for example, and in that case such a timeout is pretty much expected.
Could you put some logging code into the runner and see which commands are launched?
from process.
Could you put some logging code into the runner and see which commands are launched?
I'm not sure what you're asking me to do. Could you be more specific?
from process.
Put e.g. fwrite(STDERR, "command: $command\r\n");
in the line after the line I linked and run the reproduction script.
from process.
One important thing I should point out is that I just tried running the script with Xdebug disabled and it passes for $limit
circa 500. It is possible that Xdebug is the cause of this issue.
Edit: Never mind. $limit == 1000
still times out, even with Xdebug turned off. Disabling Xdebug seems to afford it more "bandwidth" but does not fix the issue.
from process.
@kelunik The only thing that shows up when it fails due to every request timing out is the following, just after the first request is made.
command: reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
In the case that the $limit
is low enough for the requests to pass and not time out, the following additional output is shown, after all the requests have been queued and before the first response is received:
command: reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters"
command: "C:\PHP 7.1\php.exe" -dhtml_errors=0 -ddisplay_errors=0 -dlog_errors=1 "vendor\amphp\parallel\lib\Context/Internal/process-runner.php" "vendor\amphp\parallel\lib\Worker/Internal/worker-process.php" "Amp\Parallel\Worker\BasicEnvironment"
from process.
@Bilge Does increasing the timeout to 3 seconds already work for very high concurrency loads?
from process.
Yes, but only up to a point. I can get ~500 concurrent with a 3 second timeout, but not ~1000.
from process.
@Bilge Do you have a profiler like Blackfire available? If so, could you please share a profile with 1 and 1000 requests?
from process.
Happy to help in any way I can but I don't know how to do that. I understand most cool hackers don't use Windows, but there's only so much I can do via GitHub comments. Ultimately an expert such as yourself is probably going to need direct access to Windows to get to the bottom of a fundamentally complex or esoteric issue such as this.
from process.
See https://blackfire.io/docs/introduction for an introduction. If you can't / don't want to do that, that's entirely fine. Just be aware that it will delay this issue's resolution. I think you can do similar things with xdebug.
It depends a lot on the root cause of the issue. If it's an issue in the process wrapper, @DaveRandom will indeed need to look into this. If it's not, a profile might be enough to tell where the issue is.
from process.
Related Issues (20)
- amphp/process kills sub process on exit HOT 7
- process immediate exit after sigterm HOT 6
- Amphp gets stuck in and infinite loop doing nothing if firewall delays port access HOT 6
- Not running at windows HOT 3
- How to start background processes HOT 2
- Connection failed: Amp\TimeoutException: Operation timed out in amphp\amp\lib\functions.php:275 HOT 2
- ProcessException with message 'Could not determine PID' HOT 1
- not get response of a user define method HOT 2
- php8 on windows with error HOT 4
- SocketConnector fails to close sockets on PHP8/Win
- Application stucks when launch application that requires elevated privileges on Windows HOT 1
- php8 on windows with error HOT 5
- Zombie Processes HOT 3
- v2 not working on FPM while v1 does HOT 8
- Remove Amp\Process\Internal\Windows\Barrier?
- Catching STDERR output HOT 3
- Doesn't work with dg/bypass-finals HOT 1
- Exception "ProcessException: Received 0 of 5 expected bytes" when reading from stdout out of time HOT 10
- Process getting stuck because of a full STDOUT/STDERR pipe
- amphp/process 1.x on Windows: Trying to start a non-existent executable gets stuck forever HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from process.