5 Star 7 Fork 2

xiao / fast-laravel

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

English | 中文

  ___                   _                             _ 
 / __)          _      | |                           | |
| |__ ____  ___| |_    | | ____  ____ ____ _   _ ____| |
|  __) _  |/___)  _)   | |/ _  |/ ___) _  | | | / _  ) |
| | ( ( | |___ | |__   | ( ( | | |  ( ( | |\ V ( (/ /| |
|_|  \_||_(___/ \___)  |_|\_||_|_|   \_||_| \_/ \____)_|                                             

🚀fast-laravel. is a package that made you laravel application fast.

install

first you must install composer

add require info into composer.json and execute composer install

"require": {
    "toxmc/fast-laravel":"^1.0"
},

or

composer require "toxmc/fast-laravel" -vvv

add Service Provider into config/app.php

[
    'providers' => [
        FastLaravel\Http\LaravelServiceProvider::class,
    ],
]

Publish configuration and binaries.

$ php artisan vendor:publish --tag=fast-laravel
or
$ php artisan http publish

config configuration

$ php artisan http config

start server

$ php fast http:start

command:

php artisan http {action : publish|config|infos}.
  • publish:Publish configuration and binaries.
  • config:Generate command(fast) configuration information
  • infos:show information
php fast http::{action : start|stop|restart|reload|infos} {-d|--daemonize : Whether run as a daemon for start & restart}.
  • start:start server
  • stop:stop server
  • restart:restart server
  • reload:reload server
  • infos:show information

supervisor manage services

install

brew install supervisor

start

supervisord -c supervisor/supervisor.conf

manage

[xmc@mc fast-laravel (master ✗)]$ supervisorctl -c supervisor/supervisor.conf
fast-laravel-monitor             RUNNING   pid 18131, uptime 0:03:11

supervisor> help

default commands (type help <topic>):
=====================================
add    exit      open  reload  restart   start   tail   
avail  fg        pid   remove  shutdown  status  update 
clear  maintail  quit  reread  signal    stop    version

supervisor> status
fast-laravel-monitor             RUNNING   pid 29146, uptime 3:03:36

docker

Windows Docker Desktop with WSL1's docker client.

Docker Fedora 31, CPUs:4, Memory:4G.

docker build -t=fast-laravel dockerfiles
docker run --rm -p 9100:9100 -d fast-laravel:latest
docker exec -it `docker ps -q` /bin/bash

[root@a26c3596e1b8 www]# wrk -c32 -t8 -d 30s http://127.0.0.1:9100/api/test/info
Running 30s test @ http://127.0.0.1:9100/api/test/info
  8 threads and 32 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.66ms   14.23ms 312.91ms   93.79%
    Req/Sec   775.52    122.16     1.86k    72.42%
  185354 requests in 30.06s, 41.72MB read
Requests/sec:   6165.69
Transfer/sec:      1.39MB

hot reload

1:edit .env and restart server

SWOOLE_HOT_RELOAD=true

or edit swoole_http.php

'hot_reload' => env('SWOOLE_HOT_RELOAD', true),

2:fswatch

brew install fswatch

[xmc@mc fast-laravel (master ✗)]$ sh fswatch.sh /Users/xmc/PhpstormProjects/iizhu/api
Starting fswatch...
File /Users/xmc/PhpstormProjects/iizhu/api/app/Service/TestService.php has been modified.
Reloading swoole_http_server...
> success
File /Users/xmc/PhpstormProjects/iizhu/api/app/Service/TestService.php has been modified.
Reloading swoole_http_server...
> success

Alternative

Alternative Framework

Others

  • Q群:190349019
MIT License Copyright (c) 2018 xmc Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

基于Swoole的高性能HTTP服务器。加速您的Laravel应用程序。 expand collapse
PHP and 3 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
PHP
1
https://gitee.com/smalleyes/fast-laravel.git
git@gitee.com:smalleyes/fast-laravel.git
smalleyes
fast-laravel
fast-laravel
master

Search