是“工人”的数量。在Laravel Octane中,等于可以同时处理的请求数量?

发布于 2025-02-09 20:00:18 字数 111 浏览 2 评论 0原文

我是否正确理解Laravel Octane中的“工人”数量等于可以同时执行的请求数?

例如,如果有2名工人,其中2个忙于返回CSV出口 - 新请求将不会处理?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

金兰素衣 2025-02-16 20:00:18

是的,在Laravel Octane中,工人的数量直接负责您的应用程序可以同时处理的许多请求。为了证明这一点,我们可以添加以下途径:

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

如果您与2名工人一起旋转Laravel Octane实例,并两次击中此端点 - 第三个执行必须等到两个工人中的一名自由处理。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文