{"action":"created","issue":{"url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/137","repository_url":"https://api.github.com/repos/hhxsv5/laravel-s","labels_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/137/comments","events_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/137/events","html_url":"https://github.com/hhxsv5/laravel-s/issues/137","id":431938354,"node_id":"MDU6SXNzdWU0MzE5MzgzNTQ=","number":137,"title":"祼测laravel5.5 感觉性能没有大的提升，是我的操作方式有误么？","user":{"login":"boyisire","id":12267372,"node_id":"MDQ6VXNlcjEyMjY3Mzcy","avatar_url":"https://avatars1.githubusercontent.com/u/12267372?v=4","gravatar_id":"","url":"https://api.github.com/users/boyisire","html_url":"https://github.com/boyisire","followers_url":"https://api.github.com/users/boyisire/followers","following_url":"https://api.github.com/users/boyisire/following{/other_user}","gists_url":"https://api.github.com/users/boyisire/gists{/gist_id}","starred_url":"https://api.github.com/users/boyisire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boyisire/subscriptions","organizations_url":"https://api.github.com/users/boyisire/orgs","repos_url":"https://api.github.com/users/boyisire/repos","events_url":"https://api.github.com/users/boyisire/events{/privacy}","received_events_url":"https://api.github.com/users/boyisire/received_events","type":"User","site_admin":false},"labels":[{"id":806101764,"node_id":"MDU6TGFiZWw4MDYxMDE3NjQ=","url":"https://api.github.com/repos/hhxsv5/laravel-s/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-04-11T10:05:27Z","updated_at":"2019-04-12T05:05:53Z","closed_at":null,"author_association":"NONE","body":"想在生产环境中使用swoole,我用laravel-s做测试时，发现性能没有大的变化，是我的使用方法不正确么？（所有配置都用的默认值）\r\n\r\n======================================\r\n\r\n1. 配置信息：\r\n+---------------------------+---------+\r\n| Component                 | Version |\r\n+---------------------------+---------+\r\n| PHP                       | 7.1.27  |\r\n| Swoole                    | 4.3.1   |\r\n| LaravelS                  | 3.4.4   |\r\n| Laravel Framework [local] | 5.5.45  |\r\n+---------------------------+---------+\r\n\r\n2. 测试详情\r\n2.1 空项目 \r\n注：test方法中，就写了一个\"return 0\"\r\n<1>. siege -c 100 -r 20 \"https://m.mydev.com/test\"\r\nTransactions: 2000 hits \r\nAvailability: 100.00 % \r\nElapsed time: 19.17 secs \r\nData transferred: 0.04 MB \r\nResponse time: 0.54 secs \r\nTransaction rate: 104.33 trans/sec \r\nThroughput: 0.00 MB/sec \r\nConcurrency: 55.88 \r\nSuccessful transactions: 2000 \r\nFailed transactions: 0 \r\nLongest transaction: 15.16 \r\nShortest transaction: 0.03\r\n\r\n<2>. siege -c 100 -r 20 \"https://m.mydev.com/test\"\r\nTransactions: 2000 hits \r\nAvailability: 100.00 % \r\nElapsed time: 15.24 secs \r\nData transferred: 0.04 MB \r\nResponse time: 0.57 secs \r\nTransaction rate: 131.23 trans/sec \r\nThroughput: 0.00 MB/sec \r\nConcurrency: 74.83 \r\nSuccessful transactions: 2000 \r\nFailed transactions: 0 \r\nLongest transaction: 7.17 \r\nShortest transaction: 0.04\r\n\r\n<3>. siege -c 100 -r 20 \"https://m.mydev.com/test\"\r\nTransactions: 2000 hits \r\nAvailability: 100.00 % \r\nElapsed time: 17.13 secs \r\nData transferred: 0.04 MB \r\nResponse time: 0.58 secs \r\nTransaction rate: 116.75 trans/sec \r\nThroughput: 0.00 MB/sec \r\nConcurrency: 67.96 \r\nSuccessful transactions: 2000 \r\nFailed transactions: 0 \r\nLongest transaction: 7.72 \r\nShortest transaction: 0.04\r\n\r\n2.2 使用Laravel-s后\r\n<1>. siege -c 100 -r 20 \"https://m.mydev.com/test\"\r\nTransactions:\t2000 hits\r\nAvailability:\t100.00 %\r\nElapsed time:\t16.36 secs\r\nData transferred:\t0.00 MB\r\nResponse time:\t0.57 secs\r\nTransaction rate:\t122.25 trans/sec\r\nThroughput:\t0.00 MB/sec\r\nConcurrency:\t69.71\r\nSuccessful transactions: 2000\r\nFailed transactions:\t0\r\nLongest transaction:\t14.03\r\nShortest transaction:\t0.03\r\n\r\n<2>. siege -c 100 -r 20 \"https://m.mydev.com/test\"\r\nTransactions:\t2000 hits\r\nAvailability:\t100.00 %\r\nElapsed time:\t18.47 secs\r\nData transferred:\t0.00 MB\r\nResponse time:\t0.51 secs\r\nTransaction rate:\t108.28 trans/sec\r\nThroughput:\t0.00 MB/sec\r\nConcurrency:\t54.94\r\nSuccessful transactions: 2000\r\nFailed transactions:\t0\r\nLongest transaction:\t13.78\r\nShortest transaction:\t0.03\r\n\r\n<3>. siege -c 100 -r 20 \"https://m.mydev.com/test\"\r\nTransactions:\t2000 hits\r\nAvailability:\t100.00 %\r\nElapsed time:\t18.13 secs\r\nData transferred:\t0.00 MB\r\nResponse time:\t0.53 secs\r\nTransaction rate:\t110.31 trans/sec\r\nThroughput:\t0.00 MB/sec\r\nConcurrency:\t58.38\r\nSuccessful transactions: 2000\r\nFailed transactions:\t0\r\nLongest transaction:\t14.19\r\nShortest transaction:\t0.03\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/comments/482438621","html_url":"https://github.com/hhxsv5/laravel-s/issues/137#issuecomment-482438621","issue_url":"https://api.github.com/repos/hhxsv5/laravel-s/issues/137","id":482438621,"node_id":"MDEyOklzc3VlQ29tbWVudDQ4MjQzODYyMQ==","user":{"login":"hhxsv5","id":7278743,"node_id":"MDQ6VXNlcjcyNzg3NDM=","avatar_url":"https://avatars1.githubusercontent.com/u/7278743?v=4","gravatar_id":"","url":"https://api.github.com/users/hhxsv5","html_url":"https://github.com/hhxsv5","followers_url":"https://api.github.com/users/hhxsv5/followers","following_url":"https://api.github.com/users/hhxsv5/following{/other_user}","gists_url":"https://api.github.com/users/hhxsv5/gists{/gist_id}","starred_url":"https://api.github.com/users/hhxsv5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhxsv5/subscriptions","organizations_url":"https://api.github.com/users/hhxsv5/orgs","repos_url":"https://api.github.com/users/hhxsv5/repos","events_url":"https://api.github.com/users/hhxsv5/events{/privacy}","received_events_url":"https://api.github.com/users/hhxsv5/received_events","type":"User","site_admin":false},"created_at":"2019-04-12T05:05:53Z","updated_at":"2019-04-12T05:05:53Z","author_association":"OWNER","body":"压测注意事项：\r\n1. 先阅读：https://wiki.swoole.com/wiki/page/62.html\r\n2. 注意各个中间件（包括全局中间件和路由中间件），默认的Session中间件基于文件，IO性能非常差。\r\n3. 压空接口，目的在于对比框架的消耗，对比FPM，快慢都是相对的。\r\n4. 如果代码中有类似`sleep`的同步阻塞操作，那QPS自然不会高。\r\n5. 压测时最好在内网测试，避免网络带宽因素影响结果。\r\n\r\n![image](https://user-images.githubusercontent.com/7278743/56013522-ac738080-5d23-11e9-93d9-b2fda5e36523.png)\r\n\r\n![image](https://user-images.githubusercontent.com/7278743/56013451-64ecf480-5d23-11e9-9c8a-e18661475a36.png)\r\n"}}
{"actor":{"display_login":"hhxsv5"}}