Skip to content

sj8354661/sw-fw-less

 
 

Repository files navigation

sw-fw-less

Description

Swoole http server without framework

Features

  1. Faster Router
  2. Router & Global Middleware
  3. Model(MySQL & Eleasticsearch、Json Serializable、Array Accessable)
  4. Query Builder(MySQL & Elasticsearch)
  5. Connection Pool(MySQL、Redis、Experimental AMQP-0-9-1、Experimental HBase)
  6. Storage(File、Qiniu、Alioss)
  7. Full Coroutine
  8. Log(Based on Monolog)
  9. Distributed Lock(Based on Redis)
  10. Parameter Validator
  11. Monitor
  12. AMQP-0-9-1
  13. Zipkin Trace

Requirements

  • PHP 7.1+
  • Swoole 4.2.10+

Installation

git clone [email protected]:luoxiaojun1992/sw-fw-less.git
cp .env.example .env
composer install -vvv

Deployment

Nginx

Nginx Config Demo(Modify according to your requirements)

server {
    listen 80;
    
    ## Modify according to your requirements
    server_name www.sw-fw-less.dev;

    location / {
        ## Modify according to your requirements
        proxy_pass http://127.0.0.1:9501;
    }
}

Docker

docker run -d -P luoxiaojun1992/sw-fw-less:latest

Usage

Start Server

php start.php

Demo Api

curl -i 'http://127.0.0.1:9501/ping'

Performance

Environment:

  • OS: MacOS 10.14.1
  • CPU: 2.3 GHz Intel Core i5 4 Cores
  • Memory: 16 GB 2133 MHz LPDDR3
  • Swoole: 4.2.9
  • PHP: 7.2.8
  • Redis: 4.0.11
  • API: http://127.0.0.1:9501/redis?key=key
  • Concurrent: 300
  • Tool: JMeter 4.0 r1823414

Result: Load Testing

Document

Please see document.

About

Swoole Http Server Without Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.8%
  • Dockerfile 0.2%