This package provides a high performance HTTP server to speed up your Laravel/Lumen application based on Swoole.

Overview

Laravel-Swoole

php-badge packagist-badge Total Downloads Scrutinizer Code Quality travis-badge

This package provides a high performance HTTP server to speed up your Laravel/Lumen application based on Swoole.

Version Compatibility

PHP Laravel Lumen Swoole
>=7.2 >=5.5 >=5.5 >=4.3.1

Features

  • Run Laravel/Lumen application on top of Swoole.
  • Outstanding performance boosting up to 5x faster.
  • Sandbox mode to isolate app container.
  • Support running websocket server in Laravel.
  • Support Socket.io protocol.
  • Support Swoole table for cross-process data sharing.

Documentation

Please see Wiki

Benchmark

Test with clean Lumen 5.6, using DigitalOcean 3 CPUs / 1 GB Memory / PHP 7.2 / Ubuntu 16.04.4 x64

Benchmarking Tool: wrk

wrk -t4 -c100 http://your.app

Nginx with FPM

wrk -t4 -c10 http://lumen-swoole.local

Running 10s test @ http://lumen-swoole.local
  4 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     6.41ms    1.56ms  19.71ms   71.32%
    Req/Sec   312.99     28.71   373.00     72.00%
  12469 requests in 10.01s, 3.14MB read
Requests/sec:   1245.79
Transfer/sec:    321.12KB

Swoole HTTP Server

wrk -t4 -c10 http://lumen-swoole.local:1215

Running 10s test @ http://lumen-swoole.local:1215
  4 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.39ms    4.88ms 105.21ms   94.55%
    Req/Sec     1.26k   197.13     1.85k    68.75%
  50248 requests in 10.02s, 10.88MB read
Requests/sec:   5016.94
Transfer/sec:      1.09MB

Q&A

The common questions are collected in Q&A. You can go check if your question is listed in the document.

Issues and Support

Please read Issues Guideline before you submit an issue, thanks.

Bugs and feature request are tracked on GitHub.

Credits

Huang-Yi,

Alternatives

License

The Laravel-Swoole package is open-sourced software licensed under the MIT license.

Support on Beerpay

Hey dude! Help me out for a couple of 🍻 !

Beerpay Beerpay

Comments
  • Still getting the last authenticated user for every request. Something wrong with sandbox mode?

    Still getting the last authenticated user for every request. Something wrong with sandbox mode?

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)

    Swoole 2.1.3 on PHP 7.2.5

    1. Please provide your Laravel/Lumen version.

    Laravel 5.6.20

    1. What did you do? If possible, provide a recipe for reproducing the error.

    Log in to the application via Chrome. Ensure you are logged in. Open up another browser (f.e. Firefox) and visit the application's URL. I am instantly logged in in the Firefox session.

    1. What did you expect to see?

    Not being logged in in the Firefox session.

    1. What did you see instead?

    Logged in in the Firefox session with the user I logged in with in the Chrome session.


    I have enabled sandbox mode and running laravel-swoole behind nginx. For some reason, auth isn't reset after each request. Any ideas?

    help wanted question 
    opened by emielmolenaar 35
  • Auth error in laravel 5.8 with swoole 2.6

    Auth error in laravel 5.8 with swoole 2.6

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole) PHP 7.2.24-0ubuntu0.18.04.2 (cli) (built: Jan 13 2020 18:39:59) ( NTS ) Version => 4.4.15

    2. Please provide your Laravel/Lumen version. Laravel: 5.8

    3. Which release version of this package are you using? 2.6

    4. What did you do? If possible, provide a recipe for reproducing the error.

    Websocket::on('connect',function($websocket,$request){
    var_dump($request->user());
    });
    
    1. What did you expect to see? User function

    2. What did you see instead? NULL!

    help wanted 
    opened by MostafaRabia 22
  • Discussion

    Discussion

    If i ran swoole in ip and port like this: MY_SERVER_IP:MY_SSL_PORT Without apache or nginx, is it right? it's working, but it's right?

    And if in production i need to update website, how can i update it? If i restarted swoole it will cause anything? Or what should i do?

    And very thanks.

    help wanted question 
    opened by MostafaRabia 17
  • \Illuminate\Http\Request is not reset

    \Illuminate\Http\Request is not reset

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole) PHP 7.2.13 swoole 4.2.12

    2. Please provide your Laravel/Lumen version. Laravel 5.5.44

    3. Which release version of this package are you using? v2.6.2

    4. What did you do? If possible, provide a recipe for reproducing the error.

    If sent nginx host and X - Forwarded - host and their values are not the same

    // nginx configuration eg: server { listen 83; server_name www.local-test.cn; location / { proxy_pass http://Swoole.com; proxy_set_header Host "www.swoole-test.cn"; proxy_set_header X-Forwarded-Host "www.local-test.cn"; proxy_set_header Scheme $http_x_real_proto; proxy_set_header Server_port $http_x_real_port; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; } } just like this // nginx configuration if( isset(ngx.host) && isset( ngx.X-Forwarded-Host) && (ngx.host !== ngx.X-Forwarded-Host)) { // php some controller use Illuminate\Http\Request public function someAction(Request $request): string { $eq = (spl_object_hash ($request) === spl_object_hash (app()->instances['request'])); var_dump($eq); // output : false } }

    1. What did you expect to see? The dependency injected request object === app()->instances['request'] .

    2. What did you see instead? The dependency injected request object does not change in each request, but app()->instances['request'] has changed and correct.

    question 
    opened by xutengx 14
  • Hot Reload

    Hot Reload

    I skimmed through the docs but could not find any thing regarding the Hot Reload. Looks like another library is offerring it out of the box using the inotify php extension. Do you intend to support it if currently not available?

    Here it is: https://github.com/scil/LaravelFly

    This is more of a question that's why I am not able to provide the detail here apologies for that.

    enhancement suggestion 
    opened by aftabnaveed 14
  • Request times increases in time

    Request times increases in time

    Since today i'm running an API on swoole in production.

    After swoole is started, one of my endpoints takes around 80-90ms to load.

    15 minutes later the same request takes around 130-170ms

    30 minutes later 200-250ms

    hour later 400-500ms

    If i restart swoole again, its 80-70ms again.

    I'm running it on a DO server with Ubuntu 18, php7.3, redis (cache) and nginx.

    question 
    opened by sweebee 13
  • Illuminate\Contracts\Container\BindingResolutionException: Target

    Illuminate\Contracts\Container\BindingResolutionException: Target

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)

    php v7.2.12 swoole v4.2.13

    1. Please provide your Laravel/Lumen version.

    5.7.*

    1. Which release version of this package are you using?

    2.6.5

    1. What did you do? If possible, provide a recipe for reproducing the error.

    when I open

     'access_log' => env('SWOOLE_HTTP_ACCESS_LOG', false) 
    

    in swoole_http.php config file , there was a

    ~ BindingResolutionException: Target [Illuminate\Contracts\Http\Kernel] is not instantiable.

      // there would be bug
        if ($config->get('swoole_http.server.access_log')) {
            $this->app->make(Kernel::class)->pushMiddleware(AccessLog::class);
        }
    
    1. What did you expect to see?

    I have been enabled the web_socket

    1. What did you see instead?
    question unable to reproduce 
    opened by cielu 13
  • errors with vuejs

    errors with vuejs

    Please answer these questions before submitting your issue. Thanks!

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)
    PHP 7.2.6 (cli) (built: May 25 2018 06:16:43) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies
    
    swoole
    
    swoole support => enabled
    Version => 2.2.0
    Author => tianfeng.han[email: [email protected]]
    coroutine => enabled
    kqueue => enabled
    rwlock => enabled
    async http/websocket client => enabled
    pcre => enabled
    zlib => enabled
    
    Directive => Local Value => Master Value
    swoole.aio_thread_num => 2 => 2
    swoole.display_errors => On => On
    swoole.use_namespace => On => On
    swoole.use_shortname => On => On
    swoole.fast_serialize => Off => Off
    swoole.unixsock_buffer_size => 8388608 => 8388608
    
    1. Please provide your Laravel/Lumen version. Laravel Framework 5.6.24

    2. Which release version of this package are you using? v2.3.9

    3. What did you do? If possible, provide a recipe for reproducing the error.

    • current config
    <?php
    
    use Swoole\Table;
    
    return [
        /*
        |--------------------------------------------------------------------------
        | HTTP server configurations.
        |--------------------------------------------------------------------------
        |
        | @see https://www.swoole.co.uk/docs/modules/swoole-server/configuration
        |
        */
        'server' => [
            'host'        => env('SWOOLE_HTTP_HOST', '127.0.0.1'),
            'port'        => env('SWOOLE_HTTP_PORT', '1215'),
            'public_path' => base_path('public'),
            // Determine if to use swoole to respond request for static files
            'handle_static_files' => env('SWOOLE_HANDLE_STATIC', true),
            'options'             => [
                'pid_file'              => env('SWOOLE_HTTP_PID_FILE', base_path('storage/logs/swoole_http.pid')),
                'log_file'              => env('SWOOLE_HTTP_LOG_FILE', base_path('storage/logs/swoole_http.log')),
                'daemonize'             => env('SWOOLE_HTTP_DAEMONIZE', false),
                // Normally this value should be 1~4 times larger according to your cpu cores.
                'reactor_num'     => env('SWOOLE_HTTP_REACTOR_NUM', swoole_cpu_num()),
                'worker_num'      => env('SWOOLE_HTTP_WORKER_NUM', swoole_cpu_num()),
                'task_worker_num' => env('SWOOLE_HTTP_TASK_WORKER_NUM', swoole_cpu_num()),
                // The data to receive can't be larger than buffer_output_size.
                'package_max_length' => 20 * 1024 * 1024,
                // The data to send can't be larger than buffer_output_size.
                'buffer_output_size' => 10 * 1024 * 1024,
                // Max buffer size for socket connections
                'socket_buffer_size' => 128 * 1024 * 1024,
                // Worker will restart after processing this number of request
                'max_request' => 3000,
                // Enable coroutine send
                'send_yield' => true,
                // You must add --enable-openssl while compiling Swoole
                'ssl_cert_file' => null,
                'ssl_key_file'  => null,
            ],
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Enable to turn on websocket server.
        |--------------------------------------------------------------------------
        */
        'websocket' => [
            'enabled' => env('SWOOLE_HTTP_WEBSOCKET', false),
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Console output will be transferred to response content if enabled.
        |--------------------------------------------------------------------------
        */
        'ob_output' => env('SWOOLE_OB_OUTPUT', false),
    
        /*
        |--------------------------------------------------------------------------
        | Instances here will be cleared on every request.
        |--------------------------------------------------------------------------
        */
        'instances' => [
            'auth', 'session', 'routes', 'cache', 'cookies', 'log',
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Providers here will be registered on every request.
        |--------------------------------------------------------------------------
        */
        'providers' => [
            Illuminate\Pagination\PaginationServiceProvider::class,
        ],
    
        /*
        |--------------------------------------------------------------------------
        | Define your swoole tables here.
        |
        | @see https://www.swoole.co.uk/docs/modules/swoole-table
        |--------------------------------------------------------------------------
        */
        'tables' => [
            // 'table_name' => [
            //     'size' => 1024,
            //     'columns' => [
            //         ['name' => 'column_name', 'type' => Table::TYPE_STRING, 'size' => 1024],
            //     ]
            // ],
        ],
    ];
    

    am using vuejs with laravel, and for some reason i keep getting some weird errors

    1. What did you expect to see? it should work without issues same as normal serve

    2. What did you see instead? screen shot 2018-06-08 at 6 47 34 am

    am not sure if this is an issue on my end alone or is there some conflict between swoole & vuejs

    help wanted question 
    opened by ctf0 13
  • Can't acces swoole.websocket facade in swoole job

    Can't acces swoole.websocket facade in swoole job

    PHP: 7.2.19 Swoole: 4.4.0 Laravel: 5.8.28 Laravel-swoole: 2.6.63 Queue connection: swoole

    Dispatch task:

    public function connect(Websocket $websocket, Request $request)
    {
       $fd = $websocket->getSender();
       dispatch(new Ping($fd))->delay(3);
    }
    

    Job handler:

    public function handle()
    {
        Websocket::to($this->fd)->emit('test');
    }
    

    Exception:

    ReflectionException: Class swoole.websocket does not exist in /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Container/Container.php:790
    Stack trace:
    #0 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Container/Container.php(790): ReflectionClass->__construct('swoole.websocke...')
    #1 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Container/Container.php(667): Illuminate\Container\Container->build('swoole.websocke...')
    #2 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Container/Container.php(615): Illuminate\Container\Container->resolve('swoole.websocke...', Array)
    #3 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(767): Illuminate\Container\Container->make('swoole.websocke...', Array)
    #4 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Container/Container.php(1225): Illuminate\Foundation\Application->make('swoole.websocke...')
    #5 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(175): Illuminate\Container\Container->offsetGet('swoole.websocke...')
    #6 /home/yuriy/PhpstormProjects/swoole-game/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(144): Illuminate\Support\Facades\Facade::resolveFacadeInstance('swoole.webso
    
    question 
    opened by mxp100 12
  • How to clear class static variable

    How to clear class static variable

    Hi, albertcht, my env is

    PHP Version   7.2.9     
    Swoole Version  4.1.2                                                  
    Laravel Version  5.7.3
    

    I use laravel nova, and in the nova source code, it use class static variable, how can i reset it? Thanks

    question 
    opened by mitoop 12
  • add Swoole async task

    add Swoole async task

    Issues#73

    You can use

    SwooleTask::async(function () {
         // async task
    }); 
    
    // or
    
    swoole_async_task(function () {
        // async
    });
    

    to run an async task. For example you can send an E-Mail in an async task.

    opened by damonto 12
  • high latency after loop

    high latency after loop

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)

    PHP Version | 8.1.13

    1. Please provide your Laravel/Lumen version.

    Laravel Version | Lumen (9.1.5) (Laravel Components ^9.21)

    1. Which release version of this package are you using?

    Swoole Version | 5.0.1

    1. What did you do? If possible, provide a recipe for reproducing the error.

    download content make high ms latency after loop 1 2

    1 - without swoole 2- with swoole

    1. What did you expect to see?

    2. What did you see instead?

    opened by 0utc0ntr0l2021 0
  • streamDownload not working and sometimes also throw

    streamDownload not working and sometimes also throw "allowed memory size ... exhausted"

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)
    PHP 7.4.21 (cli) (built: Jul 22 2021 02:54:54) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    
    swoole
    
    Swoole => enabled
    Author => Swoole Team <[email protected]>
    Version => 4.8.12
    Built => Oct  9 2022 10:32:04
    coroutine => enabled with boost asm context
    epoll => enabled
    eventfd => enabled
    signalfd => enabled
    cpu_affinity => enabled
    spinlock => enabled
    rwlock => enabled
    openssl => OpenSSL 1.1.1n  15 Mar 2022
    dtls => enabled
    http2 => enabled
    mutex_timedlock => enabled
    pthread_barrier => enabled
    futex => enabled
    async_redis => enabled
    
    Directive => Local Value => Master Value
    swoole.enable_coroutine => On => On
    swoole.enable_library => On => On
    swoole.enable_preemptive_scheduler => Off => Off
    swoole.display_errors => On => On
    swoole.use_shortname => On => On
    swoole.unixsock_buffer_size => 8388608 => 8388608
    
    1. Please provide your Laravel/Lumen version.

    Laravel 8.83.13

    1. Which release version of this package are you using?

    v2.12.1

    1. What did you do? If possible, provide a recipe for reproducing the error.

    I want to provide customer a option to export large data from database, but when I tried streamdownload, the application only init the download, but never starting download it. Here is a reproduce code:

    <?php
    
    namespace App\Http\Controllers;
    
    use Illuminate\Support\Str;
    use Illuminate\Support\LazyCollection;
    
    class IndexController extends Controller
    {
    /**
         * Undocumented function
         *
         * @param Request $request
         * @return void
         */
        public function export(Request $request)
        {
            $collection = LazyCollection::times(100000, fn () => [
                'user_id' => mt_rand(10, 100),
                'name' => Str::random(mt_rand(10, 20)),
                'logged_in_at' => now()->toIsoString(),
            ]);
    
            return response()->streamDownload(function () use ($collection) {
                $output = fopen('php://output', 'w+');
    
                fputcsv($output, ['User ID', 'Name', 'Login Time']);
    
                $collection->each(fn ($row) => fputcsv($output, $row));
    
                fclose($output);
            }, 'file.csv');
        }
    }
    
    1. What did you expect to see?

    download large data by streaming without consuming all memory

    1. What did you see instead?

    The browser only init the download, but never starting download content.

    https://imgur.com/a/GvGzRng

    opened by jasonbigl 1
  • How did I know swoole is succefull applied on my environment

    How did I know swoole is succefull applied on my environment

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)
    PHP 7.4.32 (cli) (built: Oct 28 2022 18:18:25) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.32, Copyright (c), by Zend Technologies
    Server API | FPM/FastCGI
    

    and

    Swoole => enabled
    Author => Swoole Team <[email protected]>
    Version => 4.8.12
    Built => Oct 29 2022 22:59:10
    coroutine => enabled with boost asm context
    epoll => enabled
    eventfd => enabled
    signalfd => enabled
    cpu_affinity => enabled
    spinlock => enabled
    rwlock => enabled
    pcre => enabled
    zlib => 1.2.11
    mutex_timedlock => enabled
    pthread_barrier => enabled
    futex => enabled
    async_redis => enabled
    Directive => Local Value => Master Value
    swoole.enable_coroutine => On => On
    swoole.enable_library => On => On
    swoole.enable_preemptive_scheduler => Off => Off
    swoole.display_errors => On => On
    swoole.use_shortname => On => On
    swoole.unixsock_buffer_size => 8388608 => 8388608
    
    
    1. Please provide your Laravel/Lumen version. "laravel/framework": "^6.0",

    2. Which release version of this package are you using?

    Version => 4.8.12
    Built => Oct 29 2022 22:59:10
    "swooletw/laravel-swoole": "^2.12"
    
    1. What did you do? If possible, provide a recipe for reproducing the error. Just Installing swoole on laravel project like on documentation. My laravel project using laradok

    2. What did you expect to see?

    How did I know swoole is succefull applied on my environment. Because I test a benchmark with wrk. Nothing improve (just a litte bit) perfomance between using swoole and not using swoole.

    1. What did you see instead? using swoole
    wrk -t3 -c10 -d5s -H 'x-api-key:fasdf' -H 'Content-Type:application/json' -H 'Accept:application/json' "http://api-test/api?limit=10"
    Running 5s test @ http://api-test/api?limit=10
      3 threads and 10 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency    58.03ms   71.92ms 339.84ms   85.70%
        Req/Sec    80.87     38.69   181.00     59.06%
      1205 requests in 5.00s, 417.75KB read
      Non-2xx or 3xx responses: 1205
    Requests/sec:    240.81
    Transfer/sec:     83.48KB
    

    no using swoole

    wrk -t3 -c10 -d5s -H 'x-api-key:fasdf' -H 'Content-Type:application/json' -H 'Accept:application/json' "http://api-test/api?limit=10"
    Running 5s test @ http://api-test/api?limit=10
      3 threads and 10 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency    56.38ms   72.46ms 344.37ms   85.71%
        Req/Sec    86.23     39.65   210.00     70.67%
      1292 requests in 5.01s, 447.91KB read
      Non-2xx or 3xx responses: 1292
    Requests/sec:    258.03
    Transfer/sec:     89.45KB
    

    run command php artisan swoole:http infos

    +-----------------+-------------------------------------------------------------------+ | Name | Value | +-----------------+-------------------------------------------------------------------+ | PHP Version | 7.4.32 | | Swoole Version | 4.8.12 | | Laravel Version | 6.20.44 | | Listen IP | 127.0.0.1 | | Listen Port | 1215 | | Server Status | Online | | Reactor Num | 8 | | Worker Num | 8 | | Task Worker Num | 0 | | Websocket Mode | Off | | Master PID | 2791 | | Manager PID | 2795 | +-----------------+-------------------------------------------------------------------+

    opened by rooniieesss 1
  • Hot reload not working

    Hot reload not working

    Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole) Swoole => enabled Author => Swoole Team [email protected] Version => 4.8.8 Built => Mar 31 2022 03:10:36 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled sockets => enabled openssl => OpenSSL 1.1.1n 15 Mar 2022 dtls => enabled http2 => enabled json => enabled curl-native => enabled zlib => 1.2.11 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled mysqlnd => enabled async_redis => enabled

    Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 8388608 => 8388608

    1. Please provide your Laravel/Lumen version. Laravel Version 8.83.19

    2. Which release version of this package are you using? 2.12.1

    3. What did you do? If possible, provide a recipe for reproducing the error. Create a project and install swoole on docker

    4. What did you expect to see? hot reload.......

    opened by TopiasTsui 1
  •  WARNING Server::check_worker_exit_status(): worker(pid=690, id=14) abnormal exit, status=0, signal=9

    WARNING Server::check_worker_exit_status(): worker(pid=690, id=14) abnormal exit, status=0, signal=9

    Every download request(more than 20MB) gets below warning and doesn't return response.

    1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)

    PHP version

    PHP 8.0.18 (cli) (built: Apr 22 2022 22:53:40) ( NTS ) Copyright (c) The PHP Group Zend Engine v4.0.18, Copyright (c) Zend Technologies with Zend OPcache v8.0.18, Copyright (c), by Zend Technologies

    swoole:

    /var/www/portal $ php8 --ri swoole

    swoole

    Swoole => enabled Author => Swoole Team [email protected] Version => 4.8.0 Built => Jul 6 2022 16:17:48 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled spinlock => enabled rwlock => enabled zlib => 1.2.12 brotli => E16777225/D16777225 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled

    Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => On => On swoole.unixsock_buffer_size => 8388608 => 8388608

    1. Please provide your Laravel/Lumen version.

    Laravel Version : 9.2

    1. What did you do? If possible, provide a recipe for reproducing the error.

    Every download request(more than 20MB) gets below warning and doesn't return response. Is it coz of any memory leak ?

    opened by vasa2856 0
Releases(v2.12.1)
  • v2.12.1(Mar 19, 2022)

  • v2.12.0(Mar 19, 2022)

  • v2.11.0(Jan 20, 2022)

    Added

    • Adding support for openswoole (https://github.com/swooletw/laravel-swoole/pull/506)

    Changed

    • Reverts https://github.com/swooletw/laravel-swoole/commit/3a93e92c8b8ad5eed8bbdf4398faa22bdef48b4f. "auth" instance became default on pre_resolve config array
    Source code(tar.gz)
    Source code(zip)
  • v2.10.0(Oct 18, 2021)

  • v2.9.0(Aug 28, 2021)

  • 2.8.2(May 13, 2021)

  • 2.8.1(Apr 22, 2021)

  • v2.8.0(Mar 15, 2021)

    Enhancement

    • Add support to PHP8. (https://github.com/swooletw/laravel-swoole/pull/474)
    • Add abillity to have hook actions at server. (https://github.com/swooletw/laravel-swoole/pull/469)
    Source code(tar.gz)
    Source code(zip)
  • v2.7.0(Feb 22, 2021)

  • v2.6.69(Jan 21, 2021)

  • v2.6.68(Sep 21, 2020)

    Enhancement

    • Add support for Laravel 8.0. (#433)

    Fixes

    • Fix class name of Dumper.php for consistency. (#427)
    • Reset websocket's connection after trying to emit to a non-existing room (#421)
    • Fix response status in AccessOutput.php (#385)
    • Fix handle_static_files path in config (#411)
    • Fix Content-Type when static file w/o extension name (#409)
    • Fix swoole_set_process_name not found error on cygwin platform
    Source code(tar.gz)
    Source code(zip)
  • v2.6.67(Mar 29, 2020)

  • v2.6.66(Dec 1, 2019)

  • v2.6.65(Oct 21, 2019)

  • v2.6.64(Aug 25, 2019)

  • v2.6.63(Jul 5, 2019)

  • v2.6.62(Jul 4, 2019)

    Features

    • Add onHandShake callback for customizing handshake implementation in websocket

    Enhancements

    • Fix potential package configuration mismatched in lumen
    • Make pid file compatible with older versions
    Source code(tar.gz)
    Source code(zip)
  • v2.6.61(Jun 2, 2019)

    Enhancement

    • Refactor pid manger. (thanks to @lilianjin )

    Fixes

    • Fix typo in configuring server process type.
    • Fix initialization for websocket room.

    Delete storage/swoole.pid file if you encounter an error after upgrading to this version.

    Source code(tar.gz)
    Source code(zip)
  • v2.6.6(Apr 20, 2019)

    Features

    • Add SwooleTW\Http\Helpers\Dumper::dump(#data) helper function

    Fixes

    • Fix minor error config in setting task worker number.
    • Fix withApplication function in lumen.
    • Fix datatype in Pusher.

    Changes

    • Drop support for Laravel 5.4 and require swoole 4.3.1

    Enhancement

    • Make Pusher support swoole 4.3
    Source code(tar.gz)
    Source code(zip)
  • v2.6.5.4(Mar 9, 2019)

  • v2.6.5.3(Mar 7, 2019)

  • v2.6.5.2(Mar 6, 2019)

  • v2.6.5.1(Mar 5, 2019)

    Fix

    • Revert task_enable_coroutine support

    Changes

    • Check strlen for response content
    • Chunk response with 8k size
    • Add raw cookie support back since Laravel 5.3 is no longer supported
    Source code(tar.gz)
    Source code(zip)
  • v2.6.5(Mar 3, 2019)

    Fixes

    • Fix potential incorrect config in registerDatabaseDriver
    • Support empty response for OPTIONS request
    • Refactor and fix websocket pusher for broadcast

    Features

    • Output error message to console when server error occurred
    • Pass full args to task event for task coroutine mode

    Changes

    • Require minimal laravel version to 5.4 and support 5.8
    Source code(tar.gz)
    Source code(zip)
  • v2.6.4(Feb 2, 2019)

  • v2.6.3(Feb 1, 2019)

  • v2.6.2(Jan 14, 2019)

  • v2.6.1(Jan 13, 2019)

  • v2.6.0(Jan 13, 2019)

    Changes

    • Add chunk support to response for better performance.
    • Some code refactors, thanks to @fractalzombie.
    • Added hot reload feature with fswatch.
    • Add support for Laravel 5.6 and 5.7.
    • Abandon support for Laravel/Lumen 5.1 and 5.2.

    Fixes

    • Fix exception report for throwable error.
    Source code(tar.gz)
    Source code(zip)
  • v2.5.0(Sep 4, 2018)

    • Make sandbox compatible with coroutine environment.
    • Require Swoole 4.0 to use coroutine feature. (Swoole 4.1 will be required in the future release.)
    • Implement context manager for coroutine feature.
    • Add tests and refactor the whole project.
    • Support Swoole async task as queue driver.
    • Allow customized resetters for initiating sandbox.
    • Allow modifying pre-resolved instances in config.
    Source code(tar.gz)
    Source code(zip)
Owner
Swoole Taiwan
Swoole community in Taiwan.
Swoole Taiwan
Kit is a lightweight, high-performance and event-driven web services framework that provides core components such as config, container, http, log and route.

Kit What is it Kit is a lightweight, high-performance and event-driven web services framework that provides core components such as config, container,

null 2 Sep 23, 2022
A easy way to install your basic yii projetc, we have encrypt database password in phpfile, my class with alot funtions to help you encrypt and decrypt and our swoole server install just run ./yii swoole/start and be happy!

Yii 2 Basic Project Template with swoole and Modules Yii 2 Basic Project Template is a skeleton Yii 2 application best for rapidly creating small proj

null 3 Apr 11, 2022
High performance HTTP Service Framework for PHP based on Workerman.

webman High performance HTTP Service Framework for PHP based on Workerman. Manual https://www.workerman.net/doc/webman Benchmarks https://www.techempo

walkor 1.3k Jan 2, 2023
💾 High-performance PHP application server, load-balancer and process manager written in Golang. RR2 releases repository.

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a serv

Spiral Scout 45 Nov 29, 2022
🤯 High-performance PHP application server, load-balancer and process manager written in Golang

RoadRunner is an open-source (MIT licensed) high-performance PHP application server, load balancer, and process manager. It supports running as a serv

Spiral Scout 6.9k Jan 3, 2023
Multi-process coroutine edition Swoole spider !! Learn about Swoole's network programming and the use of its related APIs

swoole_spider php bin/spider // Just do it !! Cache use Swoole\Table; use App\Table\Cache; $table = new Table(1<<20); // capacity size $table->column

null 3 Apr 22, 2021
swoole,easyswoole,swoole framework

EasySwoole - A High Performance Swoole Framework EasySwoole is a distributed, persistent memory PHP framework based on the Swoole extension. It was cr

null 4.6k Jan 2, 2023
swoole and golang ipc, use goroutine complete swoole coroutine

swoole and golang ipc demo swoole process module exec go excutable file as sider car, use goroutine complete swoole coroutine hub.php <?php require '

null 2 Apr 17, 2022
High-Performance Long-Living PHP Framework for modern enterprise application development

Documentation · Discord · Telegram · Twitter Spiral Framework is a High-Performance Long-Living Full-Stack framework and group of over sixty PSR-compa

Spiral Scout 1.4k Jan 1, 2023
Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP.

clue/reactphp-http-proxy Async HTTP proxy connector, tunnel any TCP/IP-based protocol through an HTTP CONNECT proxy server, built on top of ReactPHP.

Christian Lück 43 Dec 25, 2022
LaravelS is an out-of-the-box adapter between Swoole and Laravel/Lumen.

?? LaravelS is an out-of-the-box adapter between Swoole and Laravel/Lumen.

Biao Xie 3.7k Dec 29, 2022
This package provides some basic methods to implement a self updating functionality for your Laravel application. Already bundled are some methods to provide a self-update mechanism via Github or some private repository via http.

This package provides some basic methods to implement a self updating functionality for your Laravel 5 application. Already bundled are some methods to provide a self-update mechanism via Github.

Holger Lösken 311 Dec 31, 2022
Hprose asynchronous client & standalone server based on swoole

Hprose for Swoole Introduction Hprose is a High Performance Remote Object Service Engine. It is a modern, lightweight, cross-language, cross-platform,

Hprose 186 Sep 9, 2022
A sample CakePHP api application using CakeDC/cakephp-api and swoole as server

CakePHP Application Skeleton composer create-project --prefer-dist cakephp/app Added sample data using https://github.com/annexare/Countries Created m

Marcelo Rocha 3 Jul 28, 2022
High performance, full-stack PHP framework delivered as a C extension.

Phalcon Framework Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resourc

The Phalcon PHP Framework 10.7k Jan 8, 2023
Biny is a tiny, high-performance PHP framework for web applications

Biny is high performance. Framework comes default with response time of less than 1ms. Stand-alone QPS easily up to 3000.

Tencent 1.7k Dec 9, 2022
🔥High Performance PHP Progressive Framework.

The Core Framework English | 中文 The QueryPHP Application QueryPHP is a modern, high performance PHP progressive framework, to provide a stable and rel

The QueryPHP Framework 306 Dec 14, 2022
Motan - a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services

Motan-PHP Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Weibo R&D Open Source Projects 81 Nov 19, 2022
Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components

Spiral HTTP Application Skeleton Spiral Framework is a High-Performance PHP/Go Full-Stack framework and group of over sixty PSR-compatible components.

Spiral Scout 152 Dec 18, 2022