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

Fix load time when running on Octane #31

Closed
cindreta opened this issue Feb 10, 2022 · 2 comments
Closed

Fix load time when running on Octane #31

cindreta opened this issue Feb 10, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@cindreta
Copy link
Member

Description

I've mostly made sure the SDK supports Laravel Octane and Laravel Vapor. Trust me there is a huge difference :) When running Octane on Vapor it's a bit different than running Octane without Vapor. In any case i used Laravel native functions to get things like headers, data and similar.

The last thing that i can't figure out is the load time. Because Laravel Octane keeps all the the requests in memory $_SERVER['REQUEST_TIME_FLOAT'] isn't actually reset upon each request. This means that the function we have for detecting the load time won't correctly work. One idea that @khalyomede had to use Redis and store a value each time a new request is made. We could use Octane RequestReceived event to do it. But I'm afraid of using that in case there are many requests being made.

In my opinion what should happen is we should have a variable inside the class let's stay $start_time and we should set that to microtime(true) each time a new requests comes in ONLY on Octane. Again using Octane listeners we can do that like the guys at Spatie: Laravel Ignition Example

But I'm not sure how to do it. Ideas?

Thank you

@cindreta cindreta added the bug Something isn't working label Feb 10, 2022
@cindreta cindreta self-assigned this Feb 10, 2022
@cindreta
Copy link
Member Author

Will try using Octane cache to set and update the load time variable. It supports up to 2 million IOPS 🤯

@cindreta
Copy link
Member Author

Should be fixed, at least for Swoole, de3148e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant