SlideShare a Scribd company logo
Mit nginx und FastCGI skalieren


Michel Hartmann I 01.06.2011




                                  © Mayflower GmbH 2011
Michel Hartmann




●   Studium der Informatik an der Universität Würzburg


●   Seit 2008 Entwickler bei der Mayflower GmbH
Kurt Ringsock




                Mayflower GmbH I 3
Apache




         Mayflower GmbH I 4
Verarbeitung




               ...




                     Mayflower GmbH I 5
Lösung




         Mayflower GmbH I 6
Nutzung


     Totals for Active Servers Across All Domains
                 June 2000 - May 2011




                                        Quelle: netcraft.com




                                                               Mayflower GmbH I 7
Apache (mpm_worker)




      RAM         60 MB


      CPU         100 %


    Netzwerk          45 %


   Requests / s       1.500




                              Mayflower GmbH I 8
nginx




        RAM       60 MB   12 MB


        CPU       100 %    5%


    Netzwerk      40 %    100 %


   Requests / s   1.500   4.000




                                  Mayflower GmbH I 9
lighttpd




       RAM         60 MB   12 MB   X


       CPU         100 %    5%     X


     Netzwerk      40 %    100 %   X


    Requests / s   1.500   4.000   X




                                       Mayflower GmbH I 10
nginx




        Mayflower GmbH I 11
Verarbeitung – Reverse Proxy




                           ...




                                 Mayflower GmbH I 12
Konfiguration – Basis

user www-data www-data;
worker_processes 10;
events {
     worker_connections 1000;
}
http {
     include conf/mime.types;
     default_type application/octet-stream;
     sendfile on;
     gzip on;
     gzip_min_length 1000;
     gzip_types text/plain application/xml;
     keepalive_timeout 75 20;
     include sites-enabled/*;
}
                                              Mayflower GmbH I 13
Konfiguration – VHOST

server {
    server_name ringsock.de www.ringsock.de;
    root /var/www/ringsock.de/httpdocs;
    location / {
           try_files $uri /index.php?q=$uri&$args;
    }
    location ~* .php$ {
           proxy_pass http://127.0.0.1:8000/;
    }
    location = /favicon.ico {
           access_log off;
    }
}

                                                     Mayflower GmbH I 14
Benchmark




            Mayflower GmbH I 15
Caching

proxy_cache_path /data/proxy-cache/ringsock levels=1:2
    keys_zone=ringsock:10m max_size=1g inactive=30m;
proxy_temp_path /data/proxy-temp/ 1;
server {
     [...]
     location ~* .php$ {
             proxy_cache ringsock;
             proxy_cache_key "$host$request_uri";
             proxy_cache_methods GET;
             proxy_cache_bypass $cookie_nocache $arg_nocache;
             proxy_no_cache $cookie_nocache $arg_nocache;
             proxy_cache_valid 200 302 60m;
             proxy_cache_valid 404        1m;
             proxy_pass http://127.0.0.1:8000/;
     }
}
                                                                Mayflower GmbH I 16
Verarbeitung




               ...




                     Mayflower GmbH I 17
Verarbeitung




               FastCGI




                     ...



                           Mayflower GmbH I 18
FastCGI Process Manager (FPM)




                                Mayflower GmbH I 19
Konfiguration – php-fpm



[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log


[ringsock]
listen = /tmp/ringsock-fpm.socket
user = ringsock_de
group = ringsock_de
pm = dynamic
pm.start_servers = 20
pm.max_children = 100
pm.min_spare_servers = 5
pm.max_spare_servers = 20


                                    Mayflower GmbH I 20
Konfiguration – nginx

server {
    server_name ringsock.de www.ringsock.de;
    root /var/www/ringsock.de/httpdocs;
    location / {
           try_files $uri /index.php?q=$uri&$args;
    }
    location ~* .php$ {
           fastcgi_pass unix:/tmp/ringsock-fpm.socket;
           include fastcgi_params;
    }
}




                                                         Mayflower GmbH I 21
Konfiguration – nginx (fastcgi_params)


fastcgi_param   GATEWAY_INTERFACE   CGI/1.1;
fastcgi_param   SERVER_SOFTWARE     nginx;
fastcgi_param   QUERY_STRING        $query_string;
fastcgi_param   REQUEST_METHOD      $request_method;
fastcgi_param   CONTENT_TYPE        $content_type;
fastcgi_param   CONTENT_LENGTH      $content_length;
fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
fastcgi_param   SCRIPT_NAME         $fastcgi_script_name;
fastcgi_param   REQUEST_URI         $request_uri;
fastcgi_param   DOCUMENT_URI        $document_uri;
fastcgi_param   DOCUMENT_ROOT       $document_root;
fastcgi_param   SERVER_PROTOCOL     $server_protocol;
fastcgi_param   REMOTE_ADDR         $remote_addr;
fastcgi_param   REMOTE_PORT         $remote_port;
fastcgi_param   SERVER_ADDR         $server_addr;
fastcgi_param   SERVER_PORT         $server_port;
fastcgi_param   SERVER_NAME         $server_name

                                                                      Mayflower GmbH I 22
Benchmark




            Mayflower GmbH I 23
Features




           Mayflower GmbH I 24
php-fpm – Worker Pools


[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log


[ringsock]
listen = /tmp/ringsock-fpm.socket
user = ringsock_de
group = ringsock_de
…
[ringschuh]
listen = /tmp/ringschuh-fpm.socket
user = ringschuh_de
group = ringschuh_de
…

                                     Mayflower GmbH I 25
php-fpm – fastcgi_finsish_request()




<?php
require_once 'My/Application.php';
$application = new My_Application();
$application->run();
fastcgi_finish_request();
$application->postRun();




                                       Mayflower GmbH I 26
php-fpm – Slowlog


[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log


[ringsock]
listen = /tmp/ringsock-fpm.socket
user = ringsock_de
group = ringsock_de
pm = dynamic
pm.start_servers = 20
pm.max_children = 100
pm.min_spare_servers = 5
pm.max_spare_servers = 20
request_slowlog_timeout = 30
slowlog = /var/log/php5/ringsock-slow.log

                                            Mayflower GmbH I 27
php-fpm – Status & Ping

[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log


[ringsock]
listen = /tmp/ringsock-fpm.socket   pool                      ringsock
user = ringsock_de                  process manager           dynamic
group = ringsock_de
                                    accepted conn             158
pm = dynamic
                                    listen queue len          0
pm.start_servers = 20
pm.max_children = 100               max listen queue len      12
pm.min_spare_servers = 5            idle processes            20
pm.max_spare_servers = 20           active processes          2
pm.status_path = /status            total processes           22
ping.path = /ping
                                    max children reached      25
ping.response = pong
                                                           Mayflower GmbH I 28
php-fpm – Emergency Restart


[global]
pid = /var/run/php5-fpm.pid
error_log = /var/log/php5-fpm.log


[ringsock]
listen = /tmp/ringsock-fpm.socket
user = ringsock_de
group = ringsock_de
pm = dynamic
pm.start_servers = 20
pm.max_children = 100
pm.min_spare_servers = 5
pm.max_spare_servers = 20
emergency_restart_threshold = 10
emergency_restart_interval = 5m

                                    Mayflower GmbH I 29
Sicherheit


         www.ringsock.de




                           All your stockings
                           are belong to us




                                                Mayflower GmbH I 30
Konfiguration – nginx

server {
    server_name ringsock.de www.ringsock.de;
    root /var/www/ringsock.de/httpdocs;
    location / {
           try_files $uri /index.php?q=$uri&$args;
    }
    location ~* .php$ {
           fastcgi_pass unix:/tmp/ringsock-fpm.socket;
           include fastcgi_params;
    }
}




                                                         Mayflower GmbH I 31
Konfiguration – nginx

server {
    server_name ringsock.de www.ringsock.de;
    root /var/www/ringsock.de/httpdocs;
    location / {
           try_files $uri /index.php?q=$uri&$args;
    }
    location /index.php {
           fastcgi_pass unix:/tmp/ringsock-fpm.socket;
           include fastcgi_params;
    }
}




                                                         Mayflower GmbH I 32
Konfiguration – nginx

server {
    server_name ringsock.de www.ringsock.de;
    root /var/www/ringsock.de/httpdocs;
    location / {
           try_files $uri /index.php?q=$uri&$args;
    }
    location ^~ /index.php {
           fastcgi_pass unix:/tmp/ringsock-fpm.socket;
           include fastcgi_params;
    }
    location ~* .php$ {
           deny all;
    }
}
                                                         Mayflower GmbH I 33
Weiter skalieren




                   Mayflower GmbH I 34
Lastverteilung




                 -fpm    -fpm


             ...        ...


                                Mayflower GmbH I 35
Loadbalancing

upstream worker_pool {
    server worker01.ringsock.de:9000 weight=2;
    server worker02.ringsock.de:9000 weight=3;
}
server {
    [...]
    location ^~ /index.php {
            fastcgi_pass worker_pool;
            include fastcgi_params;
    }
    […]
}




                                                 Mayflower GmbH I 36
ip_hash

upstream worker_pool {
    ip_hash;
    server worker01.ringsock.de:9000;
    server worker02.ringsock.de:9000 down;
}
server {
    [...]
    location ^~ /index.php {
            fastcgi_pass worker_pool;
            include fastcgi_params;
    }
    […]
}



                                             Mayflower GmbH I 37
Failover

upstream worker_pool {
    server worker01.ringsock.de:9000 weight=2 max_fails=2 fail_timeout=60s;
    server worker02.ringsock.de:9000 weight=3 max_fails=2 fail_timeout=60s;
    server unix:/tmp/ringsock-fpm.socket backup;
}
server {
    [...]
    location ^~ /index.php {
            fastcgi_pass worker_pool;
            fastcgi_next_upstream error timeout;
            include fastcgi_params;
    }
    […]
}


                                                                              Mayflower GmbH I 38
Resümee




          Mayflower GmbH I 39
Fragen?




          Mayflower GmbH I 40
Vielen Dank für Ihre Aufmerksamkeit!




     Kontakt   Michel Hartmann
               michel.hartmann@mayflower.de
               +49 931 35965 1146
               Mayflower GmbH
               Pleichertorstr. 2
               97070 Würzburg


06/01/11                             Mayflower GmbH   41
Load Balancer



http {
    upstream webserver {
        server web01:80 weight=3;
        server web02:80;
        server web03:80;
    }

    server {
        server_name www.domain.com;
        location / {
             proxy_pass http://webserver;
        }
    }
}



                                            Mayflower GmbH I 42

More Related Content

What's hot

Workshop eZ Publish Caching Mechanisms
Workshop eZ Publish Caching MechanismsWorkshop eZ Publish Caching Mechanisms
Workshop eZ Publish Caching MechanismsKaliop-slide
 
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিWordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
Faysal Shahi
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Yiwei Ma
 
OpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial DayOpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial Day
Joshua McKenty
 
eZ Publish Caching Mechanisms
eZ Publish Caching MechanismseZ Publish Caching Mechanisms
eZ Publish Caching Mechanisms
Kaliop-slide
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
Containers for sysadmins
Containers for sysadminsContainers for sysadmins
Containers for sysadmins
Carlos de Alfonso Laguna
 
Open web mail setup
Open web mail setupOpen web mail setup
Open web mail setup
Chacheng Oo
 
Go for the paranoid network programmer
Go for the paranoid network programmerGo for the paranoid network programmer
Go for the paranoid network programmer
Eleanor McHugh
 
Symfony - modern technology in practice, Webexpo Prague
Symfony - modern technology in practice, Webexpo PragueSymfony - modern technology in practice, Webexpo Prague
Symfony - modern technology in practice, Webexpo Prague
Pavel Campr
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
Eric Ahn
 
Installation of lammps-5Nov14 on Mac OS X Yosemite
Installation of lammps-5Nov14 on Mac OS X YosemiteInstallation of lammps-5Nov14 on Mac OS X Yosemite
Installation of lammps-5Nov14 on Mac OS X Yosemite
first name chibaf
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Puppet
 
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
NETWAYS
 
Build moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longer
Build moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longerBuild moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longer
Build moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longer
Lifeng (Aaron) Han
 

What's hot (16)

Workshop eZ Publish Caching Mechanisms
Workshop eZ Publish Caching MechanismsWorkshop eZ Publish Caching Mechanisms
Workshop eZ Publish Caching Mechanisms
 
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিWordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
 
Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册Nginx 0.8.x 安装手册
Nginx 0.8.x 安装手册
 
OpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial DayOpenStack Swift - MSST 2011 Tutorial Day
OpenStack Swift - MSST 2011 Tutorial Day
 
Sn office 2010
Sn office 2010Sn office 2010
Sn office 2010
 
eZ Publish Caching Mechanisms
eZ Publish Caching MechanismseZ Publish Caching Mechanisms
eZ Publish Caching Mechanisms
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
Containers for sysadmins
Containers for sysadminsContainers for sysadmins
Containers for sysadmins
 
Open web mail setup
Open web mail setupOpen web mail setup
Open web mail setup
 
Go for the paranoid network programmer
Go for the paranoid network programmerGo for the paranoid network programmer
Go for the paranoid network programmer
 
Symfony - modern technology in practice, Webexpo Prague
Symfony - modern technology in practice, Webexpo PragueSymfony - modern technology in practice, Webexpo Prague
Symfony - modern technology in practice, Webexpo Prague
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Installation of lammps-5Nov14 on Mac OS X Yosemite
Installation of lammps-5Nov14 on Mac OS X YosemiteInstallation of lammps-5Nov14 on Mac OS X Yosemite
Installation of lammps-5Nov14 on Mac OS X Yosemite
 
Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013Vagrant + Rouster at salesforce.com - PuppetConf 2013
Vagrant + Rouster at salesforce.com - PuppetConf 2013
 
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
OSBConf 2015 | Backups with rdiff backup and rsnapshot by christoph mitasch &...
 
Build moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longer
Build moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longerBuild moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longer
Build moses on ubuntu (64 bit) system in virtubox recorded by aaron _v2longer
 

Viewers also liked

El MaletíN De Eros Parejas [Modo De Compatibilidad]
El MaletíN De Eros   Parejas [Modo De Compatibilidad]El MaletíN De Eros   Parejas [Modo De Compatibilidad]
El MaletíN De Eros Parejas [Modo De Compatibilidad]
guest0e9926
 
Salesforce1 Story - Novartis Vaccines
Salesforce1 Story - Novartis VaccinesSalesforce1 Story - Novartis Vaccines
Salesforce1 Story - Novartis VaccinesSara Ridlon
 
Super Market Garflo
Super Market GarfloSuper Market Garflo
Super Market Garflo
Garflo Supermarket
 
Top Papers 2014
Top Papers 2014Top Papers 2014
Presentación mercadeo avanzado
Presentación mercadeo avanzadoPresentación mercadeo avanzado
Presentación mercadeo avanzado
dillinger06
 
Key Legal Advisors LLP-Profile
Key Legal Advisors LLP-ProfileKey Legal Advisors LLP-Profile
Key Legal Advisors LLP-ProfileRatnesh Tomar
 
Tema 15 elena y celia
Tema 15 elena y celiaTema 15 elena y celia
Tema 15 elena y celiaBlanca Román
 
Affiliate Playbook – 2012 Edition
Affiliate Playbook – 2012 EditionAffiliate Playbook – 2012 Edition
Affiliate Playbook – 2012 Edition
Affiliate Summit
 
Forestry: Tools For Success
Forestry: Tools For SuccessForestry: Tools For Success
Forestry: Tools For SuccessLeslee
 
Nc 448. leche. especificaciones de calidad.
Nc 448. leche. especificaciones de calidad.Nc 448. leche. especificaciones de calidad.
Nc 448. leche. especificaciones de calidad.ceciliamoldes
 
Catalogo VIATECA 2016
Catalogo VIATECA 2016Catalogo VIATECA 2016
Catalogo VIATECA 2016
Viateca
 
Reinventing Prosperity
Reinventing ProsperityReinventing Prosperity
Reinventing Prosperity
Club of Rome
 
La comunicación digital
La comunicación digitalLa comunicación digital
La comunicación digital
Jose Manuel Mencia Leal
 
Co-creation & User Experience
Co-creation & User ExperienceCo-creation & User Experience
Co-creation & User Experience
Patrizia Bertini
 
Next Generation of Hadoop MapReduce
Next Generation of Hadoop MapReduceNext Generation of Hadoop MapReduce
Next Generation of Hadoop MapReducehuguk
 

Viewers also liked (20)

Doctorado dominios
Doctorado dominiosDoctorado dominios
Doctorado dominios
 
El MaletíN De Eros Parejas [Modo De Compatibilidad]
El MaletíN De Eros   Parejas [Modo De Compatibilidad]El MaletíN De Eros   Parejas [Modo De Compatibilidad]
El MaletíN De Eros Parejas [Modo De Compatibilidad]
 
Salesforce1 Story - Novartis Vaccines
Salesforce1 Story - Novartis VaccinesSalesforce1 Story - Novartis Vaccines
Salesforce1 Story - Novartis Vaccines
 
Super Market Garflo
Super Market GarfloSuper Market Garflo
Super Market Garflo
 
Top Papers 2014
Top Papers 2014Top Papers 2014
Top Papers 2014
 
Happy2016_DS_2015
Happy2016_DS_2015Happy2016_DS_2015
Happy2016_DS_2015
 
Presentación mercadeo avanzado
Presentación mercadeo avanzadoPresentación mercadeo avanzado
Presentación mercadeo avanzado
 
six Sigam with Case Study
six Sigam with Case Studysix Sigam with Case Study
six Sigam with Case Study
 
Key Legal Advisors LLP-Profile
Key Legal Advisors LLP-ProfileKey Legal Advisors LLP-Profile
Key Legal Advisors LLP-Profile
 
Sargantana
SargantanaSargantana
Sargantana
 
Tema 15 elena y celia
Tema 15 elena y celiaTema 15 elena y celia
Tema 15 elena y celia
 
Affiliate Playbook – 2012 Edition
Affiliate Playbook – 2012 EditionAffiliate Playbook – 2012 Edition
Affiliate Playbook – 2012 Edition
 
Forestry: Tools For Success
Forestry: Tools For SuccessForestry: Tools For Success
Forestry: Tools For Success
 
Nc 448. leche. especificaciones de calidad.
Nc 448. leche. especificaciones de calidad.Nc 448. leche. especificaciones de calidad.
Nc 448. leche. especificaciones de calidad.
 
Catalogo VIATECA 2016
Catalogo VIATECA 2016Catalogo VIATECA 2016
Catalogo VIATECA 2016
 
Reinventing Prosperity
Reinventing ProsperityReinventing Prosperity
Reinventing Prosperity
 
Problema juego de damas
Problema juego de damasProblema juego de damas
Problema juego de damas
 
La comunicación digital
La comunicación digitalLa comunicación digital
La comunicación digital
 
Co-creation & User Experience
Co-creation & User ExperienceCo-creation & User Experience
Co-creation & User Experience
 
Next Generation of Hadoop MapReduce
Next Generation of Hadoop MapReduceNext Generation of Hadoop MapReduce
Next Generation of Hadoop MapReduce
 

Similar to Mit nginx und FastCGI skalieren

Running PHP on nginx
Running PHP on nginxRunning PHP on nginx
Running PHP on nginx
Harald Zeitlhofer
 
10 Million hits a day with WordPress using a $15 VPS
10 Million hits a day  with WordPress using a $15 VPS10 Million hits a day  with WordPress using a $15 VPS
10 Million hits a day with WordPress using a $15 VPS
Paolo Tonin
 
Nginx + PHP
Nginx + PHPNginx + PHP
Nginx + PHP
Wataru OKAMOTO
 
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARISAMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
Kel
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
Jazkarta, Inc.
 
三分鐘用 PMM 架好監控系統
三分鐘用 PMM 架好監控系統三分鐘用 PMM 架好監控系統
三分鐘用 PMM 架好監控系統
Adam Chen
 
HTML 5 Security
HTML 5 SecurityHTML 5 Security
HTML 5 Security
Mayflower GmbH
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
RootGate
 
Hand-on Resources II: Extending SCMSWeb
Hand-on Resources II: Extending SCMSWebHand-on Resources II: Extending SCMSWeb
Hand-on Resources II: Extending SCMSWeb
Sugree Phatanapherom
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
Stein Inge Morisbak
 
Continuous testing In PHP
Continuous testing In PHPContinuous testing In PHP
Continuous testing In PHP
Eric Hogue
 
Nodejs in Production
Nodejs in ProductionNodejs in Production
Nodejs in Production
William Bruno Moraes
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp Vault
Bram Vogelaar
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624
Johan De Wit
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
Sam Keen
 
Guarding Your Code Against Bugs with Continuous Testing
Guarding Your Code Against Bugs with Continuous TestingGuarding Your Code Against Bugs with Continuous Testing
Guarding Your Code Against Bugs with Continuous Testing
Eric Hogue
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Jérémy Derussé
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
Jeroen van Dijk
 
Running PHP on Nginx
Running PHP on NginxRunning PHP on Nginx
Running PHP on Nginx
Harald Zeitlhofer
 
BeeGFS Training.pdf
BeeGFS Training.pdfBeeGFS Training.pdf
BeeGFS Training.pdf
ssusercbaa33
 

Similar to Mit nginx und FastCGI skalieren (20)

Running PHP on nginx
Running PHP on nginxRunning PHP on nginx
Running PHP on nginx
 
10 Million hits a day with WordPress using a $15 VPS
10 Million hits a day  with WordPress using a $15 VPS10 Million hits a day  with WordPress using a $15 VPS
10 Million hits a day with WordPress using a $15 VPS
 
Nginx + PHP
Nginx + PHPNginx + PHP
Nginx + PHP
 
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARISAMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
AMIMOTO: WordPress + Amazon Web Services Hands-on PARIS
 
Pyramid Deployment and Maintenance
Pyramid Deployment and MaintenancePyramid Deployment and Maintenance
Pyramid Deployment and Maintenance
 
三分鐘用 PMM 架好監控系統
三分鐘用 PMM 架好監控系統三分鐘用 PMM 架好監控系統
三分鐘用 PMM 架好監控系統
 
HTML 5 Security
HTML 5 SecurityHTML 5 Security
HTML 5 Security
 
How to install and configure LEMP stack
How to install and configure LEMP stackHow to install and configure LEMP stack
How to install and configure LEMP stack
 
Hand-on Resources II: Extending SCMSWeb
Hand-on Resources II: Extending SCMSWebHand-on Resources II: Extending SCMSWeb
Hand-on Resources II: Extending SCMSWeb
 
Zero Downtime Deployment with Ansible
Zero Downtime Deployment with AnsibleZero Downtime Deployment with Ansible
Zero Downtime Deployment with Ansible
 
Continuous testing In PHP
Continuous testing In PHPContinuous testing In PHP
Continuous testing In PHP
 
Nodejs in Production
Nodejs in ProductionNodejs in Production
Nodejs in Production
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp Vault
 
Bpug mcollective 20140624
Bpug mcollective 20140624Bpug mcollective 20140624
Bpug mcollective 20140624
 
Profiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / WebgrindProfiling PHP with Xdebug / Webgrind
Profiling PHP with Xdebug / Webgrind
 
Guarding Your Code Against Bugs with Continuous Testing
Guarding Your Code Against Bugs with Continuous TestingGuarding Your Code Against Bugs with Continuous Testing
Guarding Your Code Against Bugs with Continuous Testing
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
Running PHP on Nginx
Running PHP on NginxRunning PHP on Nginx
Running PHP on Nginx
 
BeeGFS Training.pdf
BeeGFS Training.pdfBeeGFS Training.pdf
BeeGFS Training.pdf
 

More from Mayflower GmbH

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mayflower GmbH
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
Mayflower GmbH
 
Agile Anti-Patterns
Agile Anti-PatternsAgile Anti-Patterns
Agile Anti-Patterns
Mayflower GmbH
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: Security
Mayflower GmbH
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur Führungskraft
Mayflower GmbH
 
Produktive teams
Produktive teamsProduktive teams
Produktive teams
Mayflower GmbH
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
Mayflower GmbH
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingMayflower GmbH
 
Usability im web
Usability im webUsability im web
Usability im web
Mayflower GmbH
 
Rewrites überleben
Rewrites überlebenRewrites überleben
Rewrites überleben
Mayflower GmbH
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
Mayflower GmbH
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
Mayflower GmbH
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
Mayflower GmbH
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Mayflower GmbH
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming Mythbusters
Mayflower GmbH
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im Glück
Mayflower GmbH
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefern
Mayflower GmbH
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 Sprints
Mayflower GmbH
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalieren
Mayflower GmbH
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce Breakfast
Mayflower GmbH
 

More from Mayflower GmbH (20)

Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
Mit Maintenance umgehen können- Fixt du noch Bugs oder lieferst du schon neue...
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
 
Agile Anti-Patterns
Agile Anti-PatternsAgile Anti-Patterns
Agile Anti-Patterns
 
JavaScript Days 2015: Security
JavaScript Days 2015: SecurityJavaScript Days 2015: Security
JavaScript Days 2015: Security
 
Vom Entwickler zur Führungskraft
Vom Entwickler zur FührungskraftVom Entwickler zur Führungskraft
Vom Entwickler zur Führungskraft
 
Produktive teams
Produktive teamsProduktive teams
Produktive teams
 
Salt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native ClientSalt and pepper — native code in the browser Browser using Google native Client
Salt and pepper — native code in the browser Browser using Google native Client
 
Plugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debuggingPlugging holes — javascript memory leak debugging
Plugging holes — javascript memory leak debugging
 
Usability im web
Usability im webUsability im web
Usability im web
 
Rewrites überleben
Rewrites überlebenRewrites überleben
Rewrites überleben
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
50 mal produktiver - oder warum ich gute Teams brauche und nicht gute Entwick...
 
Responsive Webdesign
Responsive WebdesignResponsive Webdesign
Responsive Webdesign
 
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und AlloyNative Cross-Platform-Apps mit Titanium Mobile und Alloy
Native Cross-Platform-Apps mit Titanium Mobile und Alloy
 
Pair Programming Mythbusters
Pair Programming MythbustersPair Programming Mythbusters
Pair Programming Mythbusters
 
Shoeism - Frau im Glück
Shoeism - Frau im GlückShoeism - Frau im Glück
Shoeism - Frau im Glück
 
Bessere Software schneller liefern
Bessere Software schneller liefernBessere Software schneller liefern
Bessere Software schneller liefern
 
Von 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 SprintsVon 0 auf 100 in 2 Sprints
Von 0 auf 100 in 2 Sprints
 
Piwik anpassen und skalieren
Piwik anpassen und skalierenPiwik anpassen und skalieren
Piwik anpassen und skalieren
 
Agilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce BreakfastAgilitaet im E-Commerce - E-Commerce Breakfast
Agilitaet im E-Commerce - E-Commerce Breakfast
 

Recently uploaded

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

Mit nginx und FastCGI skalieren

  • 1. Mit nginx und FastCGI skalieren Michel Hartmann I 01.06.2011 © Mayflower GmbH 2011
  • 2. Michel Hartmann ● Studium der Informatik an der Universität Würzburg ● Seit 2008 Entwickler bei der Mayflower GmbH
  • 3. Kurt Ringsock Mayflower GmbH I 3
  • 4. Apache Mayflower GmbH I 4
  • 5. Verarbeitung ... Mayflower GmbH I 5
  • 6. Lösung Mayflower GmbH I 6
  • 7. Nutzung Totals for Active Servers Across All Domains June 2000 - May 2011 Quelle: netcraft.com Mayflower GmbH I 7
  • 8. Apache (mpm_worker) RAM 60 MB CPU 100 % Netzwerk 45 % Requests / s 1.500 Mayflower GmbH I 8
  • 9. nginx RAM 60 MB 12 MB CPU 100 % 5% Netzwerk 40 % 100 % Requests / s 1.500 4.000 Mayflower GmbH I 9
  • 10. lighttpd RAM 60 MB 12 MB X CPU 100 % 5% X Netzwerk 40 % 100 % X Requests / s 1.500 4.000 X Mayflower GmbH I 10
  • 11. nginx Mayflower GmbH I 11
  • 12. Verarbeitung – Reverse Proxy ... Mayflower GmbH I 12
  • 13. Konfiguration – Basis user www-data www-data; worker_processes 10; events { worker_connections 1000; } http { include conf/mime.types; default_type application/octet-stream; sendfile on; gzip on; gzip_min_length 1000; gzip_types text/plain application/xml; keepalive_timeout 75 20; include sites-enabled/*; } Mayflower GmbH I 13
  • 14. Konfiguration – VHOST server { server_name ringsock.de www.ringsock.de; root /var/www/ringsock.de/httpdocs; location / { try_files $uri /index.php?q=$uri&$args; } location ~* .php$ { proxy_pass http://127.0.0.1:8000/; } location = /favicon.ico { access_log off; } } Mayflower GmbH I 14
  • 15. Benchmark Mayflower GmbH I 15
  • 16. Caching proxy_cache_path /data/proxy-cache/ringsock levels=1:2 keys_zone=ringsock:10m max_size=1g inactive=30m; proxy_temp_path /data/proxy-temp/ 1; server { [...] location ~* .php$ { proxy_cache ringsock; proxy_cache_key "$host$request_uri"; proxy_cache_methods GET; proxy_cache_bypass $cookie_nocache $arg_nocache; proxy_no_cache $cookie_nocache $arg_nocache; proxy_cache_valid 200 302 60m; proxy_cache_valid 404 1m; proxy_pass http://127.0.0.1:8000/; } } Mayflower GmbH I 16
  • 17. Verarbeitung ... Mayflower GmbH I 17
  • 18. Verarbeitung FastCGI ... Mayflower GmbH I 18
  • 19. FastCGI Process Manager (FPM) Mayflower GmbH I 19
  • 20. Konfiguration – php-fpm [global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log [ringsock] listen = /tmp/ringsock-fpm.socket user = ringsock_de group = ringsock_de pm = dynamic pm.start_servers = 20 pm.max_children = 100 pm.min_spare_servers = 5 pm.max_spare_servers = 20 Mayflower GmbH I 20
  • 21. Konfiguration – nginx server { server_name ringsock.de www.ringsock.de; root /var/www/ringsock.de/httpdocs; location / { try_files $uri /index.php?q=$uri&$args; } location ~* .php$ { fastcgi_pass unix:/tmp/ringsock-fpm.socket; include fastcgi_params; } } Mayflower GmbH I 21
  • 22. Konfiguration – nginx (fastcgi_params) fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name Mayflower GmbH I 22
  • 23. Benchmark Mayflower GmbH I 23
  • 24. Features Mayflower GmbH I 24
  • 25. php-fpm – Worker Pools [global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log [ringsock] listen = /tmp/ringsock-fpm.socket user = ringsock_de group = ringsock_de … [ringschuh] listen = /tmp/ringschuh-fpm.socket user = ringschuh_de group = ringschuh_de … Mayflower GmbH I 25
  • 26. php-fpm – fastcgi_finsish_request() <?php require_once 'My/Application.php'; $application = new My_Application(); $application->run(); fastcgi_finish_request(); $application->postRun(); Mayflower GmbH I 26
  • 27. php-fpm – Slowlog [global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log [ringsock] listen = /tmp/ringsock-fpm.socket user = ringsock_de group = ringsock_de pm = dynamic pm.start_servers = 20 pm.max_children = 100 pm.min_spare_servers = 5 pm.max_spare_servers = 20 request_slowlog_timeout = 30 slowlog = /var/log/php5/ringsock-slow.log Mayflower GmbH I 27
  • 28. php-fpm – Status & Ping [global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log [ringsock] listen = /tmp/ringsock-fpm.socket pool ringsock user = ringsock_de process manager dynamic group = ringsock_de accepted conn 158 pm = dynamic listen queue len 0 pm.start_servers = 20 pm.max_children = 100 max listen queue len 12 pm.min_spare_servers = 5 idle processes 20 pm.max_spare_servers = 20 active processes 2 pm.status_path = /status total processes 22 ping.path = /ping max children reached 25 ping.response = pong Mayflower GmbH I 28
  • 29. php-fpm – Emergency Restart [global] pid = /var/run/php5-fpm.pid error_log = /var/log/php5-fpm.log [ringsock] listen = /tmp/ringsock-fpm.socket user = ringsock_de group = ringsock_de pm = dynamic pm.start_servers = 20 pm.max_children = 100 pm.min_spare_servers = 5 pm.max_spare_servers = 20 emergency_restart_threshold = 10 emergency_restart_interval = 5m Mayflower GmbH I 29
  • 30. Sicherheit www.ringsock.de All your stockings are belong to us Mayflower GmbH I 30
  • 31. Konfiguration – nginx server { server_name ringsock.de www.ringsock.de; root /var/www/ringsock.de/httpdocs; location / { try_files $uri /index.php?q=$uri&$args; } location ~* .php$ { fastcgi_pass unix:/tmp/ringsock-fpm.socket; include fastcgi_params; } } Mayflower GmbH I 31
  • 32. Konfiguration – nginx server { server_name ringsock.de www.ringsock.de; root /var/www/ringsock.de/httpdocs; location / { try_files $uri /index.php?q=$uri&$args; } location /index.php { fastcgi_pass unix:/tmp/ringsock-fpm.socket; include fastcgi_params; } } Mayflower GmbH I 32
  • 33. Konfiguration – nginx server { server_name ringsock.de www.ringsock.de; root /var/www/ringsock.de/httpdocs; location / { try_files $uri /index.php?q=$uri&$args; } location ^~ /index.php { fastcgi_pass unix:/tmp/ringsock-fpm.socket; include fastcgi_params; } location ~* .php$ { deny all; } } Mayflower GmbH I 33
  • 34. Weiter skalieren Mayflower GmbH I 34
  • 35. Lastverteilung -fpm -fpm ... ... Mayflower GmbH I 35
  • 36. Loadbalancing upstream worker_pool { server worker01.ringsock.de:9000 weight=2; server worker02.ringsock.de:9000 weight=3; } server { [...] location ^~ /index.php { fastcgi_pass worker_pool; include fastcgi_params; } […] } Mayflower GmbH I 36
  • 37. ip_hash upstream worker_pool { ip_hash; server worker01.ringsock.de:9000; server worker02.ringsock.de:9000 down; } server { [...] location ^~ /index.php { fastcgi_pass worker_pool; include fastcgi_params; } […] } Mayflower GmbH I 37
  • 38. Failover upstream worker_pool { server worker01.ringsock.de:9000 weight=2 max_fails=2 fail_timeout=60s; server worker02.ringsock.de:9000 weight=3 max_fails=2 fail_timeout=60s; server unix:/tmp/ringsock-fpm.socket backup; } server { [...] location ^~ /index.php { fastcgi_pass worker_pool; fastcgi_next_upstream error timeout; include fastcgi_params; } […] } Mayflower GmbH I 38
  • 39. Resümee Mayflower GmbH I 39
  • 40. Fragen? Mayflower GmbH I 40
  • 41. Vielen Dank für Ihre Aufmerksamkeit! Kontakt Michel Hartmann michel.hartmann@mayflower.de +49 931 35965 1146 Mayflower GmbH Pleichertorstr. 2 97070 Würzburg 06/01/11 Mayflower GmbH 41
  • 42. Load Balancer http { upstream webserver { server web01:80 weight=3; server web02:80; server web03:80; } server { server_name www.domain.com; location / { proxy_pass http://webserver; } } } Mayflower GmbH I 42