Coder Social home page Coder Social logo

tsar-php-fpm's Introduction

tsar module for php-fpm

  1. Install tsar && tsardevel

     $ git clone git://github.com/kongjian/tsar.git
     $ cd tsar
     $ make
     $ sudo make install
     $ sudo make tsardevel
    
  2. Install tsar-php-fpm

     $ git clone https://github.com/guoxiaod/tsar-php-fpm.git
     $ cd tsar-php-fpm 
     $ make
     $ sudo make install
    
  3. Config php-fpm && nginx

     $ sudo vim /etc/php-fpm.d/www.conf
    
     # make sure /etc/php-fpm.d/www.conf has follow config:
     listen = 9000;
     pm.status_path = /php-fpm-status
    
     $ sudo vim /etc/nginx/conf.d/status.conf
    
     server {
         server_name 127.0.0.1;
         root /var/www/html;
         location /php-fpm-status {
             allow 127.0.0.1;
             deny all;
             include        fastcgi_params;
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;
         }
     }
    
  4. If your nginx has self define port or server_name, export these variables before run tsar

     export PHP_FPM_TSAR_HOST=127.0.0.1                  # default is 127.0.0.1
     export PHP_FPM_TSAR_PORT=80                         # default is 80
     export PHP_FPM_TSAR_URI=/php-fpm-status             # default is /php-fpm-status
     export PHP_FPM_TSAR_SERVER_NAME=status.example.com  # default is 127.0.0.1
    

    tsar-php-fpm will get the php-fpm status like this:

     curl -H 'Host: status.example.com' 'http://127.0.0.1:80/php-fpm-status'
    
  5. restart nginx && php-fpm

     $ sudo /etc/init.d/php-fpm restart
     $ sudo /etc/init.d/nginx restart 
    
     or 
    
     $ sudo systemctl restart php-fpm
     $ sudo systemctl restart nginx
    
  6. use tsar:

     $ tsar --php-fpm -i 1 -l
     Time              -----------------------------------------php-fpm---------------------------------------- 
     Time              accept   queue    maxq    qlen    idle  active   total  maxact  maxrea     qps    sreq   
     20/12/16-12:52:53   1.00    0.00    6.00  128.00    9.00    1.00   10.00   21.00    0.00    1.00    0.00   
     20/12/16-12:52:54   1.00    0.00    6.00  128.00    9.00    1.00   10.00   21.00    0.00    1.00    0.00   
     20/12/16-12:52:55   1.00    0.00    6.00  128.00    9.00    1.00   10.00   21.00    0.00    1.00    0.00   
    

Please feel free to setup new issue if you have any further questions.

tsar-php-fpm's People

Contributors

guoxiaod avatar

Watchers

一路向北 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.