CabalPHP基于 Swoole 的輕量級(jí)框架
CabalPHP
CabalPHP 是一個(gè)基于Swoole的輕量、高效、全異步開源框架。
亮點(diǎn)
-
全異步單機(jī)超高性能,輕松分布式部署
-
支持HTTP、TCP、websocket等多種協(xié)議
-
完善數(shù)據(jù)庫引擎,簡單高效(其他swoole框架幾乎沒有哦)
-
易于學(xué)習(xí),開發(fā)效率高,簡單高效的數(shù)據(jù)庫引擎
-
使用IDE(Sublime Text/VSCode/PhpStorm等)有完整的代碼提示
適用場景
-
微服務(wù)架構(gòu)的RPC服務(wù)開發(fā)
-
前后分離的應(yīng)用(RESTful)API接口開發(fā)
-
即時(shí)通訊服務(wù)端開發(fā)
-
傳統(tǒng)的Web網(wǎng)站,服務(wù)端渲染SEO友好
性能壓力測(cè)試
環(huán)境:
-
騰訊云 容器服務(wù)
-
鏡像: 基于 php:7.1-alpine 的swoole鏡像
-
1cores
-
256MiB - 512MiB
-
php 7.1.12
# ab -c 2000 -n 10000 http://172.16.1.79:9501/ This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 172.16.1.79 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requests Server Software: swoole-http-server Server Hostname: 172.16.1.79 Server Port: 9501 Document Path: / Document Length: 284 bytes Concurrency Level: 2000 Time taken for tests: 1.658 seconds Complete requests: 10000 Failed requests: 3 (Connect: 0, Receive: 0, Length: 3, Exceptions: 0) Write errors: 0 Total transferred: 4330003 bytes HTML transferred: 2840003 bytes Requests per second: 6031.43 [#/sec] (mean) Time per request: 331.596 [ms] (mean) Time per request: 0.166 [ms] (mean, across all concurrent requests) Transfer rate: 2550.40 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 37 154.4 2 1005 Processing: 27 252 68.8 260 547 Waiting: 0 250 69.2 259 546 Total: 79 289 165.9 267 1369 Percentage of the requests served within a certain time (ms) 50% 267 66% 284 75% 303 80% 314 90% 347 95% 365 98% 1252 99% 1279 100% 1369 (longest request)
捐助
先捐助些優(yōu)秀的代碼吧!
評(píng)論
圖片
表情
