Since the issue has been closed and there is no further activity on #724 , I thought I'd give a proposal on a minimal fix that doesn't break any current applications.
This change makes it possible to change the duration of the usleep that happens after reading the server output pipes in InteractsWithServers. Most users will not need to configure this parameter, but Laravel applications with busy stdout/stderr pipes might.
The change also proposes changing the default from 500ms to 10ms, as 500ms is a potentially large sleep where the server may be trying to write to full pipes.
Benchmarks for a heavily logging Laravel application
I initialized a Laravel application, and installed octane and FrankenPHP. I then added the following endpoint to the api routes.
Route::get('/', function () {
\Illuminate\Support\Facades\Log::info(str_repeat('a', 10000));
return [];
});
Default Laravel Octane setup
With the default setup, when working it with 2 connections over a timespan of a minute, I get the following results:
Hi.
Since the issue has been closed and there is no further activity on #724 , I thought I'd give a proposal on a minimal fix that doesn't break any current applications.
This change makes it possible to change the duration of the usleep that happens after reading the server output pipes in InteractsWithServers. Most users will not need to configure this parameter, but Laravel applications with busy stdout/stderr pipes might.
The change also proposes changing the default from 500ms to 10ms, as 500ms is a potentially large sleep where the server may be trying to write to full pipes.
Benchmarks for a heavily logging Laravel application
I initialized a Laravel application, and installed octane and FrankenPHP. I then added the following endpoint to the api routes.
Default Laravel Octane setup
With the default setup, when working it with 2 connections over a timespan of a minute, I get the following results:
Logging with LOG_CHANNEL=stderr and 500ms sleep
I then add the enviroment variable
LOG_CHANNEL=stderr
with the current laravel/octane^2.0 500ms sleepNotice the significant drop in throughput and increase in latency.
Logging with LOG_CHANNEL=stderr and 10ms sleep
Now I introduce the changes in this PR and test again
As the numbers tell, the application, with these proposed changes, are now back to the numbers of the default application logger.