laravellaravel-octane

Is the number of "workers" in Laravel Octane equal to the number of requests that can be handled simultaneously?


Do I understand correctly that the number of "workers" in Laravel Octane is equal to the number of requests that can be executed simultaneously?

For example, if there are 2 workers, and 2 of them are busy returning CSV exports - new requests will not be processed?


Solution

  • Yes, in Laravel Octane the number of workers is directly responsible for a number of requests that your app can handle simultaneously. To prove that, we can add the following route:

    Route::get('longrequest', function () {
        sleep(15);
        return 'done';
    });
    

    If you spin a Laravel Octane instance with 2 workers and hit this endpoint twice - the third execution will have to wait until one of two workers are free to process it.