Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

How did I know swoole is succefull applied on my environment #534

Open
rooniieesss opened this issue Nov 2, 2022 · 1 comment
Open

How did I know swoole is succefull applied on my environment #534

rooniieesss opened this issue Nov 2, 2022 · 1 comment

Comments

@rooniieesss
Copy link

rooniieesss commented Nov 2, 2022

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 |
+-----------------+-------------------------------------------------------------------+

@Arkanius
Copy link
Contributor

Are you sure that your swoole server is still alive between all requests?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants