zoukankan      html  css  js  c++  java
  • 系统盘的消耗 谨慎的日志存储到系统盘+日志级别!! 569 error_log = /usr/local/php7/logs/php-error.log 26 error_log = /usr/local/php7/logs/fpm_error_log

     案例:

    系统盘一夜之间骤增近20G

    nginx + php-fpm

    cat  /usr/local/nginx/conf/nginx.conf

    查看对请求的处理

    4个配置文件

    /usr/local/nginx/conf/nginx.conf

    /usr/local/php7/etc/php.ini

    /usr/local/php7/etc/php-fpm.conf

    /usr/local/php7/etc/php-fpm.d/www.conf

     cat /usr/local/php7/etc/php.ini -n

    【569 error_log = /usr/local/php7/logs/php-error.log】

    php.ini

    391 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    392 ; Error handling and logging ;
    393 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    394
    395 ; This directive informs PHP of which errors, warnings and notices you would like
    396 ; it to take action for. The recommended way of setting values for this
    397 ; directive is through the use of the error level constants and bitwise
    398 ; operators. The error level constants are below here for convenience as well as
    399 ; some common settings and their meanings.
    400 ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
    401 ; those related to E_NOTICE and E_STRICT, which together cover best practices and
    402 ; recommended coding standards in PHP. For performance reasons, this is the
    403 ; recommend error reporting setting. Your production server shouldn't be wasting
    404 ; resources complaining about best practices and coding standards. That's what
    405 ; development servers and development settings are for.
    406 ; Note: The php.ini-development file has this setting as E_ALL. This
    407 ; means it pretty much reports everything which is exactly what you want during
    408 ; development and early testing.
    409 ;
    410 ; Error Level Constants:
    411 ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
    412 ; E_ERROR - fatal run-time errors
    413 ; E_RECOVERABLE_ERROR - almost fatal run-time errors
    414 ; E_WARNING - run-time warnings (non-fatal errors)
    415 ; E_PARSE - compile-time parse errors
    416 ; E_NOTICE - run-time notices (these are warnings which often result
    417 ; from a bug in your code, but it's possible that it was
    418 ; intentional (e.g., using an uninitialized variable and
    419 ; relying on the fact it is automatically initialized to an
    420 ; empty string)
    421 ; E_STRICT - run-time notices, enable to have PHP suggest changes
    422 ; to your code which will ensure the best interoperability
    423 ; and forward compatibility of your code
    424 ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
    425 ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
    426 ; initial startup
    427 ; E_COMPILE_ERROR - fatal compile-time errors
    428 ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    429 ; E_USER_ERROR - user-generated error message
    430 ; E_USER_WARNING - user-generated warning message
    431 ; E_USER_NOTICE - user-generated notice message
    432 ; E_DEPRECATED - warn about code that will not work in future versions
    433 ; of PHP
    434 ; E_USER_DEPRECATED - user-generated deprecation warnings
    435 ;
    436 ; Common Values:
    437 ; E_ALL (Show all errors, warnings and notices including coding standards.)
    438 ; E_ALL & ~E_NOTICE (Show all errors, except for notices)
    439 ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.)
    440 ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
    441 ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
    442 ; Development Value: E_ALL
    443 ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
    444 ; http://php.net/error-reporting
    445 ;error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
    446 error_reporting = E_ALL | E_STRICT
    447
    448 ; This directive controls whether or not and where PHP will output errors,
    449 ; notices and warnings too. Error output is very useful during development, but
    450 ; it could be very dangerous in production environments. Depending on the code
    451 ; which is triggering the error, sensitive information could potentially leak
    452 ; out of your application such as database usernames and passwords or worse.
    453 ; For production environments, we recommend logging errors rather than
    454 ; sending them to STDOUT.
    455 ; Possible Values:
    456 ; Off = Do not display any errors
    457 ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
    458 ; On or stdout = Display errors to STDOUT
    459 ; Default Value: On
    460 ; Development Value: On
    461 ; Production Value: Off
    462 ; http://php.net/display-errors
    463 display_errors = On
    464
    465 ; The display of errors which occur during PHP's startup sequence are handled
    466 ; separately from display_errors. PHP's default behavior is to suppress those
    467 ; errors from clients. Turning the display of startup errors on can be useful in
    468 ; debugging configuration problems. We strongly recommend you
    469 ; set this to 'off' for production servers.
    470 ; Default Value: Off
    471 ; Development Value: On
    472 ; Production Value: Off
    473 ; http://php.net/display-startup-errors
    474 display_startup_errors = Off
    475
    476 ; Besides displaying errors, PHP can also log errors to locations such as a
    477 ; server-specific log, STDERR, or a location specified by the error_log
    478 ; directive found below. While errors should not be displayed on productions
    479 ; servers they should still be monitored and logging is a great way to do that.
    480 ; Default Value: Off
    481 ; Development Value: On
    482 ; Production Value: On
    483 ; http://php.net/log-errors
    484 log_errors = On
    485
    486 ; Set maximum length of log_errors. In error_log information about the source is
    487 ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
    488 ; http://php.net/log-errors-max-len
    489 log_errors_max_len = 1024
    490
    491 ; Do not log repeated messages. Repeated errors must occur in same file on same
    492 ; line unless ignore_repeated_source is set true.
    493 ; http://php.net/ignore-repeated-errors
    494 ignore_repeated_errors = Off
    495
    496 ; Ignore source of message when ignoring repeated messages. When this setting
    497 ; is On you will not log errors with repeated messages from different files or
    498 ; source lines.
    499 ; http://php.net/ignore-repeated-source
    500 ignore_repeated_source = Off
    501
    502 ; If this parameter is set to Off, then memory leaks will not be shown (on
    503 ; stdout or in the log). This has only effect in a debug compile, and if
    504 ; error reporting includes E_WARNING in the allowed list
    505 ; http://php.net/report-memleaks
    506 report_memleaks = On
    507
    508 ; This setting is on by default.
    509 ;report_zend_debug = 0
    510
    511 ; Store the last error/warning message in $php_errormsg (boolean). Setting this value
    512 ; to On can assist in debugging and is appropriate for development servers. It should
    513 ; however be disabled on production servers.
    514 ; Default Value: Off
    515 ; Development Value: On
    516 ; Production Value: Off
    517 ; http://php.net/track-errors
    518 track_errors = Off
    519
    520 ; Turn off normal error reporting and emit XML-RPC error XML
    521 ; http://php.net/xmlrpc-errors
    522 ;xmlrpc_errors = 0
    523
    524 ; An XML-RPC faultCode
    525 ;xmlrpc_error_number = 0
    526
    527 ; When PHP displays or logs an error, it has the capability of formatting the
    528 ; error message as HTML for easier reading. This directive controls whether
    529 ; the error message is formatted as HTML or not.
    530 ; Note: This directive is hardcoded to Off for the CLI SAPI
    531 ; Default Value: On
    532 ; Development Value: On
    533 ; Production value: On
    534 ; http://php.net/html-errors
    535 html_errors = On
    536
    537 ; If html_errors is set to On *and* docref_root is not empty, then PHP
    538 ; produces clickable error messages that direct to a page describing the error
    539 ; or function causing the error in detail.
    540 ; You can download a copy of the PHP manual from http://php.net/docs
    541 ; and change docref_root to the base URL of your local copy including the
    542 ; leading '/'. You must also specify the file extension being used including
    543 ; the dot. PHP's default behavior is to leave these settings empty, in which
    544 ; case no links to documentation are generated.
    545 ; Note: Never use this feature for production boxes.
    546 ; http://php.net/docref-root
    547 ; Examples
    548 ;docref_root = "/phpmanual/"
    549
    550 ; http://php.net/docref-ext
    551 ;docref_ext = .html
    552
    553 ; String to output before an error message. PHP's default behavior is to leave
    554 ; this setting blank.
    555 ; http://php.net/error-prepend-string
    556 ; Example:
    557 ;error_prepend_string = "<span style='color: #ff0000'>"
    558
    559 ; String to output after an error message. PHP's default behavior is to leave
    560 ; this setting blank.
    561 ; http://php.net/error-append-string
    562 ; Example:
    563 ;error_append_string = "</span>"
    564
    565 ; Log errors to specified file. PHP's default behavior is to leave this value
    566 ; empty.
    567 ; http://php.net/error-log
    568 ; Example:
    569 error_log = /usr/local/php7/logs/php-error.log
    570 ; Log errors to syslog (Event Log on Windows).
    571 ;error_log = syslog
    572
    573 ;windows.show_crt_warning
    574 ; Default value: 0
    575 ; Development value: 0
    576 ; Production value: 0
    577
    578 ;;;;;;;;;;;;;;;;;
    579 ; Data Handling ;
    580 ;;;;;;;;;;;;;;;;;
    581


    [root@d ~]# cat /usr/local/php7/etc/php-fpm.conf -n
    1 ;;;;;;;;;;;;;;;;;;;;;
    2 ; FPM Configuration ;
    3 ;;;;;;;;;;;;;;;;;;;;;
    4
    5 ; All relative paths in this configuration file are relative to PHP's install
    6 ; prefix (/usr/local/php7). This prefix can be dynamically changed by using the
    7 ; '-p' argument from the command line.
    8
    9 ;;;;;;;;;;;;;;;;;;
    10 ; Global Options ;
    11 ;;;;;;;;;;;;;;;;;;
    12
    13 [global]
    14 ; Pid file
    15 ; Note: the default prefix is /usr/local/php7/var
    16 ; Default Value: none
    17 ;pid = run/php-fpm.pid
    18
    19 ; Error log file
    20 ; If it's set to "syslog", log is sent to syslogd instead of being written
    21 ; in a local file.
    22 ; Note: the default prefix is /usr/local/php7/var
    23 ; Default Value: log/php-fpm.log
    24 ;error_log = log/php-fpm.log
    25 ;catch_workers_output = yes
    26 error_log = /usr/local/php7/logs/fpm_error_log
    27
    28 ; syslog_facility is used to specify what type of program is logging the
    29 ; message. This lets syslogd specify that messages from different facilities
    30 ; will be handled differently.
    31 ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
    32 ; Default Value: daemon
    33 ;syslog.facility = daemon
    34
    35 ; syslog_ident is prepended to every message. If you have multiple FPM
    36 ; instances running on the same server, you can change the default value
    37 ; which must suit common needs.
    38 ; Default Value: php-fpm
    39 ;syslog.ident = php-fpm
    40
    41 ; Log level
    42 ; Possible Values: alert, error, warning, notice, debug
    43 ; Default Value: notice
    44 ;log_level = notice
    45
    46 ; If this number of child processes exit with SIGSEGV or SIGBUS within the time
    47 ; interval set by emergency_restart_interval then FPM will restart. A value
    48 ; of '0' means 'Off'.
    49 ; Default Value: 0
    50 ;emergency_restart_threshold = 0
    51
    52 ; Interval of time used by emergency_restart_interval to determine when
    53 ; a graceful restart will be initiated. This can be useful to work around
    54 ; accidental corruptions in an accelerator's shared memory.
    55 ; Available Units: s(econds), m(inutes), h(ours), or d(ays)
    56 ; Default Unit: seconds
    57 ; Default Value: 0
    58 ;emergency_restart_interval = 0
    59
    60 ; Time limit for child processes to wait for a reaction on signals from master.
    61 ; Available units: s(econds), m(inutes), h(ours), or d(ays)
    62 ; Default Unit: seconds
    63 ; Default Value: 0
    64 ;process_control_timeout = 0
    65
    66 ; The maximum number of processes FPM will fork. This has been design to control
    67 ; the global number of processes when using dynamic PM within a lot of pools.
    68 ; Use it with caution.
    69 ; Note: A value of 0 indicates no limit
    70 ; Default Value: 0
    71 ; process.max = 128
    72
    73 ; Specify the nice(2) priority to apply to the master process (only if set)
    74 ; The value can vary from -19 (highest priority) to 20 (lower priority)
    75 ; Note: - It will only work if the FPM master process is launched as root
    76 ; - The pool process will inherit the master process priority
    77 ; unless it specified otherwise
    78 ; Default Value: no set
    79 ; process.priority = -19
    80
    81 ; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
    82 ; Default Value: yes
    83 ;daemonize = yes
    84
    85 ; Set open file descriptor rlimit for the master process.
    86 ; Default Value: system defined value
    87 ;rlimit_files = 1024
    88
    89 ; Set max core size rlimit for the master process.
    90 ; Possible Values: 'unlimited' or an integer greater or equal to 0
    91 ; Default Value: system defined value
    92 ;rlimit_core = 0
    93
    94 ; Specify the event mechanism FPM will use. The following is available:
    95 ; - select (any POSIX os)
    96 ; - poll (any POSIX os)
    97 ; - epoll (linux >= 2.5.44)
    98 ; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
    99 ; - /dev/poll (Solaris >= 7)
    100 ; - port (Solaris >= 10)
    101 ; Default Value: not set (auto detection)
    102 ;events.mechanism = epoll
    103
    104 ; When FPM is build with systemd integration, specify the interval,
    105 ; in second, between health report notification to systemd.
    106 ; Set to 0 to disable.
    107 ; Available Units: s(econds), m(inutes), h(ours)
    108 ; Default Unit: seconds
    109 ; Default value: 10
    110 ;systemd_interval = 10
    111
    112 ;;;;;;;;;;;;;;;;;;;;
    113 ; Pool Definitions ;
    114 ;;;;;;;;;;;;;;;;;;;;
    115
    116 ; Multiple pools of child processes may be started with different listening
    117 ; ports and different management options. The name of the pool will be
    118 ; used in logs and stats. There is no limitation on the number of pools which
    119 ; FPM can handle. Your system will tell you anyway :)
    120
    121 ; Include one or more files. If glob(3) exists, it is used to include a bunch of
    122 ; files from a glob(3) pattern. This directive can be used everywhere in the
    123 ; file.
    124 ; Relative path can also be used. They will be prefixed by:
    125 ; - the global prefix if it's been set (-p argument)
    126 ; - /usr/local/php7 otherwise
    127 include=/usr/local/php7/etc/php-fpm.d/*.conf
    [root@d ~]#


    [root@d personas]# cat /usr/local/php7/etc/php-fpm.d/www.conf -n
    1 ; Start a new pool named 'www'.
    2 ; the variable $pool can we used in any directive and will be replaced by the
    3 ; pool name ('www' here)
    4 [www]
    5
    6 ; Per pool prefix
    7 ; It only applies on the following directives:
    8 ; - 'access.log'
    9 ; - 'slowlog'
    10 ; - 'listen' (unixsocket)
    11 ; - 'chroot'
    12 ; - 'chdir'
    13 ; - 'php_values'
    14 ; - 'php_admin_values'
    15 ; When not set, the global prefix (or /usr/local/php7) applies instead.
    16 ; Note: This directive can also be relative to the global prefix.
    17 ; Default Value: none
    18 ;prefix = /path/to/pools/$pool
    19
    20 ; Unix user/group of processes
    21 ; Note: The user is mandatory. If the group is not set, the default user's group
    22 ; will be used.
    23 user = nginx
    24 group = nginx
    25
    26 ; The address on which to accept FastCGI requests.
    27 ; Valid syntaxes are:
    28 ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
    29 ; a specific port;
    30 ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
    31 ; a specific port;
    32 ; 'port' - to listen on a TCP socket to all addresses
    33 ; (IPv6 and IPv4-mapped) on a specific port;
    34 ; '/path/to/unix/socket' - to listen on a unix socket.
    35 ; Note: This value is mandatory.
    36 listen = 127.0.0.1:9000
    37
    38 ; Set listen(2) backlog.
    39 ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
    40 ;listen.backlog = 511
    41
    42 ; Set permissions for unix socket, if one is used. In Linux, read/write
    43 ; permissions must be set in order to allow connections from a web server. Many
    44 ; BSD-derived systems allow connections regardless of permissions.
    45 ; Default Values: user and group are set as the running user
    46 ; mode is set to 0660
    47 ;listen.owner = nginx
    48 ;listen.group = nginx
    49 ;listen.mode = 0660
    50 ; When POSIX Access Control Lists are supported you can set them using
    51 ; these options, value is a comma separated list of user/group names.
    52 ; When set, listen.owner and listen.group are ignored
    53 ;listen.acl_users =
    54 ;listen.acl_groups =
    55
    56 ; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
    57 ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
    58 ; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
    59 ; must be separated by a comma. If this value is left blank, connections will be
    60 ; accepted from any ip address.
    61 ; Default Value: any
    62 ;listen.allowed_clients = 127.0.0.1
    63
    64 ; Specify the nice(2) priority to apply to the pool processes (only if set)
    65 ; The value can vary from -19 (highest priority) to 20 (lower priority)
    66 ; Note: - It will only work if the FPM master process is launched as root
    67 ; - The pool processes will inherit the master process priority
    68 ; unless it specified otherwise
    69 ; Default Value: no set
    70 ; process.priority = -19
    71
    72 ; Choose how the process manager will control the number of child processes.
    73 ; Possible Values:
    74 ; static - a fixed number (pm.max_children) of child processes;
    75 ; dynamic - the number of child processes are set dynamically based on the
    76 ; following directives. With this process management, there will be
    77 ; always at least 1 children.
    78 ; pm.max_children - the maximum number of children that can
    79 ; be alive at the same time.
    80 ; pm.start_servers - the number of children created on startup.
    81 ; pm.min_spare_servers - the minimum number of children in 'idle'
    82 ; state (waiting to process). If the number
    83 ; of 'idle' processes is less than this
    84 ; number then some children will be created.
    85 ; pm.max_spare_servers - the maximum number of children in 'idle'
    86 ; state (waiting to process). If the number
    87 ; of 'idle' processes is greater than this
    88 ; number then some children will be killed.
    89 ; ondemand - no children are created at startup. Children will be forked when
    90 ; new requests will connect. The following parameter are used:
    91 ; pm.max_children - the maximum number of children that
    92 ; can be alive at the same time.
    93 ; pm.process_idle_timeout - The number of seconds after which
    94 ; an idle process will be killed.
    95 ; Note: This value is mandatory.
    96 pm = dynamic
    97
    98 ; The number of child processes to be created when pm is set to 'static' and the
    99 ; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
    100 ; This value sets the limit on the number of simultaneous requests that will be
    101 ; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
    102 ; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
    103 ; CGI. The below defaults are based on a server without much resources. Don't
    104 ; forget to tweak pm.* to fit your needs.
    105 ; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
    106 ; Note: This value is mandatory.
    107 pm.max_children = 5
    108
    109 ; The number of child processes created on startup.
    110 ; Note: Used only when pm is set to 'dynamic'
    111 ; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
    112 pm.start_servers = 2
    113
    114 ; The desired minimum number of idle server processes.
    115 ; Note: Used only when pm is set to 'dynamic'
    116 ; Note: Mandatory when pm is set to 'dynamic'
    117 pm.min_spare_servers = 1
    118
    119 ; The desired maximum number of idle server processes.
    120 ; Note: Used only when pm is set to 'dynamic'
    121 ; Note: Mandatory when pm is set to 'dynamic'
    122 pm.max_spare_servers = 3
    123
    124 ; The number of seconds after which an idle process will be killed.
    125 ; Note: Used only when pm is set to 'ondemand'
    126 ; Default Value: 10s
    127 ;pm.process_idle_timeout = 10s;
    128
    129 ; The number of requests each child process should execute before respawning.
    130 ; This can be useful to work around memory leaks in 3rd party libraries. For
    131 ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
    132 ; Default Value: 0
    133 ;pm.max_requests = 500
    134
    135 ; The URI to view the FPM status page. If this value is not set, no URI will be
    136 ; recognized as a status page. It shows the following informations:
    137 ; pool - the name of the pool;
    138 ; process manager - static, dynamic or ondemand;
    139 ; start time - the date and time FPM has started;
    140 ; start since - number of seconds since FPM has started;
    141 ; accepted conn - the number of request accepted by the pool;
    142 ; listen queue - the number of request in the queue of pending
    143 ; connections (see backlog in listen(2));
    144 ; max listen queue - the maximum number of requests in the queue
    145 ; of pending connections since FPM has started;
    146 ; listen queue len - the size of the socket queue of pending connections;
    147 ; idle processes - the number of idle processes;
    148 ; active processes - the number of active processes;
    149 ; total processes - the number of idle + active processes;
    150 ; max active processes - the maximum number of active processes since FPM
    151 ; has started;
    152 ; max children reached - number of times, the process limit has been reached,
    153 ; when pm tries to start more children (works only for
    154 ; pm 'dynamic' and 'ondemand');
    155 ; Value are updated in real time.
    156 ; Example output:
    157 ; pool: www
    158 ; process manager: static
    159 ; start time: 01/Jul/2011:17:53:49 +0200
    160 ; start since: 62636
    161 ; accepted conn: 190460
    162 ; listen queue: 0
    163 ; max listen queue: 1
    164 ; listen queue len: 42
    165 ; idle processes: 4
    166 ; active processes: 11
    167 ; total processes: 15
    168 ; max active processes: 12
    169 ; max children reached: 0
    170 ;
    171 ; By default the status page output is formatted as text/plain. Passing either
    172 ; 'html', 'xml' or 'json' in the query string will return the corresponding
    173 ; output syntax. Example:
    174 ; http://www.foo.bar/status
    175 ; http://www.foo.bar/status?json
    176 ; http://www.foo.bar/status?html
    177 ; http://www.foo.bar/status?xml
    178 ;
    179 ; By default the status page only outputs short status. Passing 'full' in the
    180 ; query string will also return status for each pool process.
    181 ; Example:
    182 ; http://www.foo.bar/status?full
    183 ; http://www.foo.bar/status?json&full
    184 ; http://www.foo.bar/status?html&full
    185 ; http://www.foo.bar/status?xml&full
    186 ; The Full status returns for each process:
    187 ; pid - the PID of the process;
    188 ; state - the state of the process (Idle, Running, ...);
    189 ; start time - the date and time the process has started;
    190 ; start since - the number of seconds since the process has started;
    191 ; requests - the number of requests the process has served;
    192 ; request duration - the duration in µs of the requests;
    193 ; request method - the request method (GET, POST, ...);
    194 ; request URI - the request URI with the query string;
    195 ; content length - the content length of the request (only with POST);
    196 ; user - the user (PHP_AUTH_USER) (or '-' if not set);
    197 ; script - the main script called (or '-' if not set);
    198 ; last request cpu - the %cpu the last request consumed
    199 ; it's always 0 if the process is not in Idle state
    200 ; because CPU calculation is done when the request
    201 ; processing has terminated;
    202 ; last request memory - the max amount of memory the last request consumed
    203 ; it's always 0 if the process is not in Idle state
    204 ; because memory calculation is done when the request
    205 ; processing has terminated;
    206 ; If the process is in Idle state, then informations are related to the
    207 ; last request the process has served. Otherwise informations are related to
    208 ; the current request being served.
    209 ; Example output:
    210 ; ************************
    211 ; pid: 31330
    212 ; state: Running
    213 ; start time: 01/Jul/2011:17:53:49 +0200
    214 ; start since: 63087
    215 ; requests: 12808
    216 ; request duration: 1250261
    217 ; request method: GET
    218 ; request URI: /test_mem.php?N=10000
    219 ; content length: 0
    220 ; user: -
    221 ; script: /home/fat/web/docs/php/test_mem.php
    222 ; last request cpu: 0.00
    223 ; last request memory: 0
    224 ;
    225 ; Note: There is a real-time FPM status monitoring sample web page available
    226 ; It's available in: /usr/local/php7/share/php/fpm/status.html
    227 ;
    228 ; Note: The value must start with a leading slash (/). The value can be
    229 ; anything, but it may not be a good idea to use the .php extension or it
    230 ; may conflict with a real PHP file.
    231 ; Default Value: not set
    232 ;pm.status_path = /status
    233
    234 ; The ping URI to call the monitoring page of FPM. If this value is not set, no
    235 ; URI will be recognized as a ping page. This could be used to test from outside
    236 ; that FPM is alive and responding, or to
    237 ; - create a graph of FPM availability (rrd or such);
    238 ; - remove a server from a group if it is not responding (load balancing);
    239 ; - trigger alerts for the operating team (24/7).
    240 ; Note: The value must start with a leading slash (/). The value can be
    241 ; anything, but it may not be a good idea to use the .php extension or it
    242 ; may conflict with a real PHP file.
    243 ; Default Value: not set
    244 ;ping.path = /ping
    245
    246 ; This directive may be used to customize the response of a ping request. The
    247 ; response is formatted as text/plain with a 200 response code.
    248 ; Default Value: pong
    249 ;ping.response = pong
    250
    251 ; The access log file
    252 ; Default: not set
    253 ;access.log = log/$pool.access.log
    254
    255 ; The access log format.
    256 ; The following syntax is allowed
    257 ; %%: the '%' character
    258 ; %C: %CPU used by the request
    259 ; it can accept the following format:
    260 ; - %{user}C for user CPU only
    261 ; - %{system}C for system CPU only
    262 ; - %{total}C for user + system CPU (default)
    263 ; %d: time taken to serve the request
    264 ; it can accept the following format:
    265 ; - %{seconds}d (default)
    266 ; - %{miliseconds}d
    267 ; - %{mili}d
    268 ; - %{microseconds}d
    269 ; - %{micro}d
    270 ; %e: an environment variable (same as $_ENV or $_SERVER)
    271 ; it must be associated with embraces to specify the name of the env
    272 ; variable. Some exemples:
    273 ; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
    274 ; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
    275 ; %f: script filename
    276 ; %l: content-length of the request (for POST request only)
    277 ; %m: request method
    278 ; %M: peak of memory allocated by PHP
    279 ; it can accept the following format:
    280 ; - %{bytes}M (default)
    281 ; - %{kilobytes}M
    282 ; - %{kilo}M
    283 ; - %{megabytes}M
    284 ; - %{mega}M
    285 ; %n: pool name
    286 ; %o: output header
    287 ; it must be associated with embraces to specify the name of the header:
    288 ; - %{Content-Type}o
    289 ; - %{X-Powered-By}o
    290 ; - %{Transfert-Encoding}o
    291 ; - ....
    292 ; %p: PID of the child that serviced the request
    293 ; %P: PID of the parent of the child that serviced the request
    294 ; %q: the query string
    295 ; %Q: the '?' character if query string exists
    296 ; %r: the request URI (without the query string, see %q and %Q)
    297 ; %R: remote IP address
    298 ; %s: status (response code)
    299 ; %t: server time the request was received
    300 ; it can accept a strftime(3) format:
    301 ; %d/%b/%Y:%H:%M:%S %z (default)
    302 ; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
    303 ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
    304 ; %T: time the log has been written (the request has finished)
    305 ; it can accept a strftime(3) format:
    306 ; %d/%b/%Y:%H:%M:%S %z (default)
    307 ; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
    308 ; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
    309 ; %u: remote user
    310 ;
    311 ; Default: "%R - %u %t "%m %r" %s"
    312 ;access.format = "%R - %u %t "%m %r%Q%q" %s %f %{mili}d %{kilo}M %C%%"
    313
    314 ; The log file for slow requests
    315 ; Default Value: not set
    316 ; Note: slowlog is mandatory if request_slowlog_timeout is set
    317 ;slowlog = log/$pool.log.slow
    318
    319 ; The timeout for serving a single request after which a PHP backtrace will be
    320 ; dumped to the 'slowlog' file. A value of '0s' means 'off'.
    321 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    322 ; Default Value: 0
    323 ;request_slowlog_timeout = 0
    324
    325 ; The timeout for serving a single request after which the worker process will
    326 ; be killed. This option should be used when the 'max_execution_time' ini option
    327 ; does not stop script execution for some reason. A value of '0' means 'off'.
    328 ; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
    329 ; Default Value: 0
    330 ;request_terminate_timeout = 0
    331
    332 ; Set open file descriptor rlimit.
    333 ; Default Value: system defined value
    334 ;rlimit_files = 1024
    335
    336 ; Set max core size rlimit.
    337 ; Possible Values: 'unlimited' or an integer greater or equal to 0
    338 ; Default Value: system defined value
    339 ;rlimit_core = 0
    340
    341 ; Chroot to this directory at the start. This value must be defined as an
    342 ; absolute path. When this value is not set, chroot is not used.
    343 ; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
    344 ; of its subdirectories. If the pool prefix is not set, the global prefix
    345 ; will be used instead.
    346 ; Note: chrooting is a great security feature and should be used whenever
    347 ; possible. However, all PHP paths will be relative to the chroot
    348 ; (error_log, sessions.save_path, ...).
    349 ; Default Value: not set
    350 ;chroot =
    351
    352 ; Chdir to this directory at the start.
    353 ; Note: relative path can be used.
    354 ; Default Value: current directory or / when chroot
    355 ;chdir = /var/www
    356
    357 ; Redirect worker stdout and stderr into main error log. If not set, stdout and
    358 ; stderr will be redirected to /dev/null according to FastCGI specs.
    359 ; Note: on highloaded environement, this can cause some delay in the page
    360 ; process time (several ms).
    361 ; Default Value: no
    362 ;catch_workers_output = yes
    363
    364 ; Clear environment in FPM workers
    365 ; Prevents arbitrary environment variables from reaching FPM worker processes
    366 ; by clearing the environment in workers before env vars specified in this
    367 ; pool configuration are added.
    368 ; Setting to "no" will make all environment variables available to PHP code
    369 ; via getenv(), $_ENV and $_SERVER.
    370 ; Default Value: yes
    371 ;clear_env = no
    372
    373 ; Limits the extensions of the main script FPM will allow to parse. This can
    374 ; prevent configuration mistakes on the web server side. You should only limit
    375 ; FPM to .php extensions to prevent malicious users to use other extensions to
    376 ; exectute php code.
    377 ; Note: set an empty value to allow all extensions.
    378 ; Default Value: .php
    379 ;security.limit_extensions = .php .php3 .php4 .php5 .php7
    380
    381 ; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
    382 ; the current environment.
    383 ; Default Value: clean env
    384 ;env[HOSTNAME] = $HOSTNAME
    385 ;env[PATH] = /usr/local/bin:/usr/bin:/bin
    386 ;env[TMP] = /tmp
    387 ;env[TMPDIR] = /tmp
    388 ;env[TEMP] = /tmp
    389
    390 ; Additional php.ini defines, specific to this pool of workers. These settings
    391 ; overwrite the values previously defined in the php.ini. The directives are the
    392 ; same as the PHP SAPI:
    393 ; php_value/php_flag - you can set classic ini defines which can
    394 ; be overwritten from PHP call 'ini_set'.
    395 ; php_admin_value/php_admin_flag - these directives won't be overwritten by
    396 ; PHP call 'ini_set'
    397 ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
    398
    399 ; Defining 'extension' will load the corresponding shared extension from
    400 ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
    401 ; overwrite previously defined php.ini values, but will append the new value
    402 ; instead.
    403
    404 ; Note: path INI options can be relative and will be expanded with the prefix
    405 ; (pool, global or /usr/local/php7)
    406
    407 ; Default Value: nothing is defined by default except the values in php.ini and
    408 ; specified at startup with the -d argument
    409 ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
    410 php_flag[display_errors] = on
    411 ;php_admin_value[error_log] = /var/log/fpm-php.www.log
    412 ;php_admin_flag[log_errors] = on
    413 ;php_admin_value[memory_limit] = 32M
    [root@d personas]#

    PHP: FastCGI 进程管理器(FPM) - Manual http://php.net/manual/zh/install.fpm.php

    基于 php.ini 的配置文件。

    tail -100  /usr/local/php7/logs/fpm_error_log

    [30-Sep-2018 09:01:52] WARNING: [pool www] child 624 exited on signal 11 (SIGSEGV) after 0.002911 seconds from start
    [30-Sep-2018 09:01:52] NOTICE: [pool www] child 633 started
    [30-Sep-2018 09:01:52] WARNING: [pool www] child 627 exited on signal 11 (SIGSEGV) after 0.002016 seconds from start
    [30-Sep-2018 09:01:52] NOTICE: [pool www] child 634 started
    [30-Sep-2018 09:01:52] WARNING: [pool www] child 628 exited on signal 11 (SIGSEGV) after 0.002039 seconds from start
    [30-Sep-2018 09:01:52] NOTICE: [pool www] child 635 started
    [30-Sep-2018 09:01:52] WARNING: [pool www] child 629 exited on signal 11 (SIGSEGV) after 0.002177 seconds from start
    [30-Sep-2018 09:01:52] NOTICE: [pool www] child 638 started
    [30-Sep-2018 09:01:52] WARNING: [pool www] child 632 exited on signal 11 (SIGSEGV) after 0.002048 seconds from start
    [30-Sep-2018 09:01:52] NOTICE: [pool www] child 63[30-Sep-2018 09:02:14] NOTICE: [pool www] child 31802 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31796 exited on signal 11 (SIGSEGV) after 0.002662 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31804 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31798 exited on signal 11 (SIGSEGV) after 0.002638 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31805 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31799 exited on signal 11 (SIGSEGV) after 0.002590 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31807 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31801 exited on signal 11 (SIGSEGV) after 0.002547 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31808 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31802 exited on signal 11 (SIGSEGV) after 0.002505 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31810 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31804 exited on signal 11 (SIGSEGV) after 0.002545 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31811 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31805 exited on signal 11 (SIGSEGV) after 0.002562 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31813 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31807 exited on signal 11 (SIGSEGV) after 0.002598 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31814 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31808 exited on signal 11 (SIGSEGV) after 0.002603 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31816 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31810 exited on signal 11 (SIGSEGV) after 0.002561 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31817 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31811 exited on signal 11 (SIGSEGV) after 0.002514 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31819 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31813 exited on signal 11 (SIGSEGV) after 0.002500 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31820 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31814 exited on signal 11 (SIGSEGV) after 0.002485 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31822 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31816 exited on signal 11 (SIGSEGV) after 0.002515 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31823 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31817 exited on signal 11 (SIGSEGV) after 0.002554 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31825 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31819 exited on signal 11 (SIGSEGV) after 0.002556 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31826 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31820 exited on signal 11 (SIGSEGV) after 0.002558 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31828 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31822 exited on signal 11 (SIGSEGV) after 0.002593 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31829 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31823 exited on signal 11 (SIGSEGV) after 0.002616 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31831 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31825 exited on signal 11 (SIGSEGV) after 0.002567 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31832 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31826 exited on signal 11 (SIGSEGV) after 0.002581 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31834 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31828 exited on signal 11 (SIGSEGV) after 0.002546 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31835 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31829 exited on signal 11 (SIGSEGV) after 0.002507 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31837 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31831 exited on signal 11 (SIGSEGV) after 0.002581 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31838 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31832 exited on signal 11 (SIGSEGV) after 0.002564 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31840 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31834 exited on signal 11 (SIGSEGV) after 0.002555 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31841 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31835 exited on signal 11 (SIGSEGV) after 0.002529 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31843 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31837 exited on signal 11 (SIGSEGV) after 0.002506 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31844 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31838 exited on signal 11 (SIGSEGV) after 0.002488 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31846 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31840 exited on signal 11 (SIGSEGV) after 0.002496 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31847 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31841 exited on signal 11 (SIGSEGV) after 0.002531 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31849 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31843 exited on signal 11 (SIGSEGV) after 0.002506 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31850 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31844 exited on signal 11 (SIGSEGV) after 0.002496 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31852 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31846 exited on signal 11 (SIGSEGV) after 0.002553 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31853 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31847 exited on signal 11 (SIGSEGV) after 0.002515 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31855 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31849 exited on signal 11 (SIGSEGV) after 0.002556 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31856 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31850 exited on signal 11 (SIGSEGV) after 0.002567 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31858 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31852 exited on signal 11 (SIGSEGV) after 0.002540 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31859 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31853 exited on signal 11 (SIGSEGV) after 0.002574 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31861 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31855 exited on signal 11 (SIGSEGV) after 0.002521 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31862 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31856 exited on signal 11 (SIGSEGV) after 0.002529 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31864 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31858 exited on signal 11 (SIGSEGV) after 0.002499 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31865 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31859 exited on signal 11 (SIGSEGV) after 0.002469 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31867 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31861 exited on signal 11 (SIGSEGV) after 0.002525 seconds from start
    [30-Sep-2018 09:02:14] NOTICE: [pool www] child 31868 started
    [30-Sep-2018 09:02:14] WARNING: [pool www] child 31862 exited on signal 11 (SIGSEGV) after 0.002537 seconds from start

  • 相关阅读:
    思科交换机密码的破解
    windows server 2008 R2 NPS(网络连接策略服务)设置radius,实现telent登陆交换机路由器权限分配
    Windows Server 2008 R2服务器系统安全设置参考指南
    svn 从文件上次修改以来没有任何文件修改或加入。
    fragment The specified child already has a parent. You must call removeView()
    Android初级教程_获取Android控件的宽和高
    Caused by: java.lang.IllegalStateException: commit already called
    Android 仿携程活动列表边框布局
    Android 解决在初次打开Activity加载布局文件时,ScrollView滚动条不在顶部的问题
    中国首个开源 HTML5 跨屏前端框架 分享
  • 原文地址:https://www.cnblogs.com/rsapaper/p/9732206.html
Copyright © 2011-2022 走看看