Skip to content

Site no longer accessible after exactly 400 requests #516

Description

@jeroenpf

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

  1. Start Studio site (but don't open it)
  2. Run ab -n 400 http://localhost:<port> (Apache benchmarking tool)
  3. Observe that it fails at exactly 398 requests.
  4. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions