Quick summary
As i was doing some benchmark tests after we updated the version of Playground, I found that after exactly 400 requests the site is no longer accessible.
I pinned this down to our use of rotatePHPRuntime - this is a rotation mechanism that replaces the PHP instance with a fresh one after n events. See the Playground source code for more information.
In essence, the rotation mechanism is there to deal with memory leaks that could be imposed by third-party extensions that we use.
We use the rotatePHPRuntime when we create a PHP instance: see here
While we successfully rotate PHP instances, those fresh instances come without any mounts leading to 404 not found responses. We need to ensure that if we choose to continue using the rotation mechanism, that we initialize new instances with the appropriate mounts.
Alternatively, we could consider to remove the rotation of PHP instances altogether, but we need to thoroughly test that this does not lead to performance and resource usage issues.
Steps to reproduce
- Start Studio site (but don't open it)
- Run
ab -n 400 http://localhost:<port> (Apache benchmarking tool)
- Observe that it fails at exactly 398 requests.
- Try to open the site and observe it responds with a not found 404 page.
What you expected to happen
The site should continue working after 400 requests
What actually happened
The site stopped working after the 400th request.
Impact
All
Available workarounds?
Yes, easy to implement
Platform
Mac Silicon
Logs or notes
No response
Quick summary
As i was doing some benchmark tests after we updated the version of Playground, I found that after exactly 400 requests the site is no longer accessible.
I pinned this down to our use of
rotatePHPRuntime- this is a rotation mechanism that replaces the PHP instance with a fresh one afternevents. See the Playground source code for more information.In essence, the rotation mechanism is there to deal with memory leaks that could be imposed by third-party extensions that we use.
We use the
rotatePHPRuntimewhen we create a PHP instance: see hereWhile we successfully rotate PHP instances, those fresh instances come without any mounts leading to 404 not found responses. We need to ensure that if we choose to continue using the rotation mechanism, that we initialize new instances with the appropriate mounts.
Alternatively, we could consider to remove the rotation of PHP instances altogether, but we need to thoroughly test that this does not lead to performance and resource usage issues.
Steps to reproduce
ab -n 400 http://localhost:<port>(Apache benchmarking tool)What you expected to happen
The site should continue working after 400 requests
What actually happened
The site stopped working after the 400th request.
Impact
All
Available workarounds?
Yes, easy to implement
Platform
Mac Silicon
Logs or notes
No response