swoole | FastD Swoole 基础组件 - 高性能网络服务组件 | Application Framework library

 by   fastdlabs PHP Version: v2.0.4 License: MIT

kandi X-RAY | swoole Summary

kandi X-RAY | swoole Summary

swoole is a PHP library typically used in Server, Application Framework, Composer applications. swoole has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

高性能网络服务组件. 提供底层服务封装, 基础管理及客户端调用功能. 使用 composer 进行管理, 可在此基础上进行封装整合.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              swoole has a low active ecosystem.
              It has 74 star(s) with 16 fork(s). There are 10 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 0 open issues and 3 have been closed. On average issues are closed in 136 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of swoole is v2.0.4

            kandi-Quality Quality

              swoole has 0 bugs and 0 code smells.

            kandi-Security Security

              swoole has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              swoole code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              swoole is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              swoole releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.
              swoole saves you 610 person hours of effort in developing the same functionality from scratch.
              It has 1420 lines of code, 201 functions and 59 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed swoole and discovered the below as its top functions. This is intended to give you an instant insight into swoole implemented functionality, and help decide if they suit your requirements.
            • Get server status
            • Watch directories .
            • Wrap the body .
            • Start the child process .
            • Set an event .
            • On request
            • onReceive
            • Handles a packet
            • Handle swoole process
            • Forward request to specified URL .
            Get all kandi verified functions for this library.

            swoole Key Features

            No Key Features are available at this moment for swoole.

            swoole Examples and Code Snippets

            No Code Snippets are available at this moment for swoole.

            Community Discussions

            QUESTION

            Unsupported operating system with Docker on windows 10 with wsl2
            Asked 2021-Feb-28 at 23:53

            I installed docker and downloaded an ubuntu distro to run with laravel sail,planing to use swoole php,and made it default,also made wsl version to 2

            with docker-compose.yml ready from laravel sail docker-compose.yml:

            but every time I try to run the sail up cmd,it gives me this error " Unsupported operating system [MINGW64_NT-10.0]. Laravel Sail supports macOS, Linux, and Windows (WSL2)."

            any ideas how to fix this ?

            ...

            ANSWER

            Answered 2021-Feb-28 at 23:53

            You need to run the sail up command from inside your WSL2 Ubuntu Image not directly from your terminal. Once you do that it should work ok

            Source https://stackoverflow.com/questions/66412753

            QUESTION

            PHP Swoole Notice ERRNO 1005
            Asked 2021-Jan-24 at 19:12

            When Swoole is on heavy load and heavy requests I kept getting this Log:

            [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
            [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
            [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
            [2021-01-24 16:07:22 *33833.2] NOTICE finish (ERRNO 1005): session#21022 does not exists
            [2021-01-24 16:07:39 *33835.4] NOTICE finish (ERRNO 1005): session#21025 does not exists
            [2021-01-24 16:07:39 *33835.4] NOTICE finish (ERRNO 1005): session#21025 does not exists
            [2021-01-24 16:07:39 *33835.4] NOTICE end (ERRNO 1005): session[21025] is closed


            Or

            [2021-01-23 14:07:22 *5300.3] NOTICE php_swoole_http_onReceive (ERRNO 1005): session[10002] is closed
            [2021-01-23 14:07:22 *5300.3] NOTICE php_swoole_http_onReceive (ERRNO 1005): session[10042] is closed
            [2021-01-23 14:08:21 *5326.29] NOTICE php_swoole_http_onReceive (ERRNO 1005): session[10508] is closed
            [2021-01-23 14:18:15 *5333.36] NOTICE finish (ERRNO 1005): session#12755 does not exists
            [2021-01-23 14:18:15 *5333.36] NOTICE end (ERRNO 1005): session[12755] is closed

            In example I send total 500k requests with 1k concurrent requests, it logs this errors and hangs ! And suddenly it hangs !
            My server is Centos 7, 8 gigabytes of RAM and 4 cores of CPU.
            Swoole is running with 40 workers, + 30 Master-Worker and 8 Reactor.
            Even in production this happens too.
            Can some one help me or explain me why this happens and maybe how can I solve it?
            Thanks.

            ...

            ANSWER

            Answered 2021-Jan-24 at 19:12

            Ok I have found where is the problem. Actually it's not a bug in Swoole or my application. It's a notice log that can get disabled with log_level property of Swoole server configuration. This happens when a Client closes swoole tab or browser (Closes client connection), so it gets disconnected so Swoole cannot retrieve users session and logs this notice. Also if you are using bench marking tools like Apache ab or WRK, If a problem occurs, These testers will terminate all other requests and stop whole testing. So sessions get closed and logs written again.

            Source https://stackoverflow.com/questions/65870949

            QUESTION

            PHP-Swoole error accept() failed, Error: Too many open files[24]
            Asked 2021-Jan-19 at 14:48

            I have installed php/swoole on my server and configured it using Laravel swoole

            Now The problem is everything works fine until total requests per second number increase more than 1000 requests.
            Swoole will log an error and not responding to user !
            I have set Operating system ulimit number to 50000
            But still get same error ! Searching all over internet and find nothing !
            Os Centos 7
            Server is good enough to handle more than 1k requests per second

            If you have any experience about this please share it with me

            Note:
            When swoole starts, it logs this error too:
            set_max_connection: max_connection is exceed the maximum value, it's reset to 1024

            ...

            ANSWER

            Answered 2021-Jan-19 at 14:48

            Ok I have figured it out.
            lets first say that how I ran PHP-Swoole process: .
            I have made a systemd service in centos in order to launch swoole process all the time in any situation..
            So the ULimit command sets ulimit for current shell that you are in it. Not the systemd shell that is running swoole starter process..
            For that you need to add LimitNOFILE=100000 option under systemd [Service] section block.
            And with a restart everything works fine.

            Source https://stackoverflow.com/questions/65773964

            QUESTION

            Swoole WebSocket Server - communication between client
            Asked 2020-Jul-12 at 07:51

            I'm trying to understand how are we supposed to manage client in Swoole Websocket Server.

            I've MyServer who extends from Swoole\WebSocket\Server, I store in a property the client list, but it seems every single client can only see his own list (with only him in it). So if the client 1 send a message who have to be resent to the client 2, the only I've found is to use the getClientList method and send the message to all clients.

            But I want also to "bind" clients between themselves ... Like 1 with 2 only, 3 with 4 a,nd 5 etc.

            I use APCu (forced to CLI mode) to communicate client list to all my client, but it seems I've some multi acces problems now.

            Isnt a "native" way in Swoole Websocket Server to store information on my client, information who could by read from any client?

            ...

            ANSWER

            Answered 2020-Jul-12 at 07:51

            After some more research, I found that Swoole provide a nice build-in class to manage session interaction : Swoole/Table

            It's a fast "SQL like" memory management system that allow you to easily communicate between sessions, specifically usefull for websockets session!

            Source https://stackoverflow.com/questions/62330175

            QUESTION

            Is it possible to install swoole in windows machine?
            Asked 2020-Apr-27 at 07:34

            I have installed Laravel 5 with php7 and which is working perfectly on my Windows machine. Recently I came to know that SWOOLE is a promising tool for PHP developers!

            Unfortunately, I couldn't find any SWOOLE installers for windows.

            Isn't it possible to install SWOOLE on a Windows machine, if so how?

            Thanks in advance.

            ...

            ANSWER

            Answered 2018-Jul-01 at 20:43

            No.For now swoole is only supported for linux and Mac.

            Source https://stackoverflow.com/questions/51122931

            QUESTION

            How to install swoole in mac-os
            Asked 2020-Jan-31 at 15:49

            Am trying to install swoole using PHP 7.0.2 in MAMP

            ...

            ANSWER

            Answered 2018-Jul-30 at 03:20

            I have no luck installing Swoole via home brew or pecl. So I installed it manually and works. So here my step:

            Make sure you php installed on your osx

            Source https://stackoverflow.com/questions/51120098

            QUESTION

            Docker can see image.png file, but no image is displayed in browser
            Asked 2019-Aug-23 at 17:50

            I'm playing around learning Docker and Swoole. Running a Docker container that contains 2 files and an empty directory. Upon accessing the HTTP server in browser, the image is not displayed (getting the broken image icon).

            I've already tried a PNG from an external webpage, that image was displayed properly. I've also tried "docker run -it hello-swoole sh" and confirmed the container displays

            ...

            ANSWER

            Answered 2019-Aug-23 at 04:05

            I would assume you have to also program the server to serve the static files.

            Example here

            Source https://stackoverflow.com/questions/57619635

            QUESTION

            How to properly auto wire an Interface in Symfony 4.3.x when the method requires parameters?
            Asked 2019-Aug-15 at 15:01

            I am trying to build a Symfony 4.3.3 command where I want to add the ability for callback functions to be overwritten at any time. Look at the following code snippet:

            ...

            ANSWER

            Answered 2019-Aug-14 at 19:43

            You still want to create a closure to pass to $server->on. You can do as such with:

            Source https://stackoverflow.com/questions/57500936

            QUESTION

            Is wrk benchmark tool reliable for testing fastest php framework
            Asked 2019-Aug-10 at 10:53

            So I tried to test php framework on my localhost (6 year old i7 pc) using:

            ...

            ANSWER

            Answered 2019-Aug-10 at 10:53

            Yes, Wrk is one of the most respected benchmarking tool but you can not tell you boss that your application will handle 176,000 requests/second

            because there will be some added conditions which will reduce the application performance. To get the correct benchmark score you can test by replicating all those conditions on your development environment and try benchmarking.

            Conditions like

            1. Database Connection (if Application is using Database)
            2. Server Configuration
            3. Reverse Proxy from your HTTP Server (i.e. Nginx or Apache) Very important
            4. And other application-specific conditions

            Source https://stackoverflow.com/questions/56980470

            QUESTION

            Class 'Swoole\MySQL' not found
            Asked 2019-Aug-07 at 07:41

            Async Mysql Client of Swoole in my PHP Project for which I am trying to use Swoole MySQL Class of PHP but I am getting

            class not found

            error while executing the code.

            Below is the code snippet I was trying to execute:

            ...

            ANSWER

            Answered 2019-Aug-07 at 07:41

            It seems that the official documentation is either a bit off, or mentions a previous version of Swoole.

            The class that should be used is Swoole\Coroutine\MySQL.

            You can verify that using the official documentation in their GitHub repository.

            Source https://stackoverflow.com/questions/57387576

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install swoole

            You can download it from GitHub.
            PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/fastdlabs/swoole.git

          • CLI

            gh repo clone fastdlabs/swoole

          • sshUrl

            git@github.com:fastdlabs/swoole.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Application Framework Libraries

            Try Top Libraries by fastdlabs

            fastD

            by fastdlabsPHP

            http

            by fastdlabsPHP

            routing

            by fastdlabsPHP

            dobee

            by fastdlabsPHP

            queue

            by fastdlabsPHP