laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.71k stars 284 forks source link

Octane fwrite no space on disk disable logging #877

Closed sts-ryan-holton closed 2 months ago

sts-ryan-holton commented 2 months ago

Octane Version

2.3.7

Laravel Version

11.4.0

PHP Version

8.3.6

What server type are you using?

Swoole

Server Version

Latest

Database Driver & Version

MySQL 8.0

Description

When the server is low on disk space, Octane is unable to write to a file. Does Octane really need to write to a file or can logging to a file be disabled so that octane can continuously run?

Steps To Reproduce

The StreamHandler is responsible for this because when trying to run php artisan octane:start an error is thrown on the fwrite.

/**
 * Stream the given request information to stdout.
 *
 * @return void
 */
public static function request(string $method, string $url, int $statusCode, float $duration)
{
    fwrite(STDOUT, json_encode([
        'type' => 'request',
        'method' => $method,
        'url' => $url,
        'memory' => memory_get_usage(),
        'statusCode' => $statusCode,
        'duration' => $duration,
    ])."\n");
}
driesvints commented 2 months ago

I'm not sure what you expect here? If your server is low on disk space you'll need to increase your disk size or free up space. This is currently how Octane works, yeah.

sts-ryan-holton commented 2 months ago

@driesvints Just wondered in the above whether there's a flag to disable the fwrite since it only appears to be for debugging purposes?