容器技术交流

 找回密码
 立即注册
查看: 5679|回复: 11

php-fpm.log出现错误。

[复制链接]
发表于 2011-7-12 07:43:14 | 显示全部楼层 |阅读模式
出现很多 下面的 错误信息。该怎么修复?
Jul 11 17:19:31.092025 [WARNING] fpm_children_bury(), line 215: child 47879 (pool default) exited on signal 15 SIGTERM after 231.482204 seconds from start

我 2G 的服务器打开 php程序 也很卡。都几十秒才打开。慢的不行。
Intel(R) Core(TM)2 Duo CPU     E7300  @ 2.66GHz (2660.00-MHz 686-class CPU)

 楼主| 发表于 2011-7-12 07:55:25 | 显示全部楼层
网上找了很多资料都说

# vi /etc/sysctl.conf
底部添加
fs.file-max=65535
#vi /etc/security/limits.conf
加上
* soft nofile 65535
* hard nofile 65535

============
但是 freebsd 没有 /etc/security/limits.conf
发表于 2011-7-12 08:49:01 | 显示全部楼层
whjtoby 发表于 2011-7-12 07:55
网上找了很多资料都说

# vi /etc/sysctl.conf

将附件中的sysctl.conf代替/etc/目录下的同名文件
然后重启一系统:reboot

sysctl.conf

992 Bytes, 下载次数: 3056

 楼主| 发表于 2011-7-12 11:58:09 | 显示全部楼层
还是不行。。。html 文件没问题。 php 的就不行。
 楼主| 发表于 2011-7-12 12:02:56 | 显示全部楼层
9000.conf 文件


<?xml version="1.0" ?>
<configuration>
        <section name="global_options">
                <value name="pid_file">/usr/local/php_fcgi/logs/php-fpm-9000.pid</value>
                <value name="error_log">/var/log/php-fpm.log</value>
                <value name="log_level">notice</value>
                <value name="emergency_restart_threshold">10</value>
                <value name="emergency_restart_interval">1m</value>
                <value name="process_control_timeout">5s</value>
                <value name="daemonize">yes</value>
        </section>

        <workers>
                <section name="pool">
                        <value name="name">default</value>
                        <value name="listen_address">127.0.0.1:9000</value>
                        <value name="listen_options">
                                <value name="backlog">-1</value>
                                <value name="owner">zijidelu</value>
                                <value name="group">zijideluGroup</value>
                                <value name="mode">0666</value>
                        </value>
                        <value name="php_defines">
                                <value name="open_basedir">/home/ftp/1520/FOOGLEOFFERS-20110514081536-xoWbtR/:/home/ftp/1520/gwwcn-20110415085034-kYHota/:/home/ftp/1520/qqnice-20110416010756-qtNaPF/:/home/ftp/1520/iipj-20110418074816-oCVNse/:/home/ftp/1520/emntkfzx_com-20110415112625-VnUOaZ/:/home/ftp/1520/whctedu-20110415104423-oFnGbw/:/home/ftp/1520/csczj_com-20110416095002-LxHPXY/:/tmp:/var/tmp</value>
                        </value>
                        <value name="user">zijidelu</value>
                        <value name="group">zijideluGroup</value>
                        <value name="pm">
                                <value name="style">static</value>
                                <value name="max_children">80</value>
                                <value name="apache_like">
                                        <value name="StartServers">1</value>
                                        <value name="MinSpareServers">3</value>
                                        <value name="MaxSpareServers">50</value>
                                </value>
                        </value>
                        <value name="request_terminate_timeout">120s</value>
                        <value name="request_slowlog_timeout">0s</value>
                        <value name="slowlog">logs/slow.log</value>
                        <value name="rlimit_files">51200</value>
                        <value name="rlimit_core">0</value>
                        <value name="chroot"></value>
                        <value name="chdir"></value>
                        <value name="catch_workers_output">yes</value>
                        <value name="max_requests">10240</value>
                        <value name="allowed_clients">127.0.0.1</value>
                        <value name="environment">
                                <value name="HOSTNAME">$HOSTNAME</value>
                                <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
                                <value name="TMP">/tmp</value>
                                <value name="TMPDIR">/tmp</value>
                                <value name="TEMP">/tmp</value>
                                <value name="OSTYPE">$OSTYPE</value>
                                <value name="MACHTYPE">$MACHTYPE</value>
                                <value name="MALLOC_CHECK_">2</value>
                        </value>
                </section>
        </workers>
</configuration>

=================================

php_fpm.conf

<?xml version="1.0" ?>
<configuration>

        All relative paths in this config are relative to php's install prefix

        <section name="global_options">

                Pid file
                <value name="pid_file">/usr/local/php_fcgi/logs/php-fpm.pid</value>

                Error log file
                <value name="error_log">/usr/local/php_fcgi/logs/php-fpm.log</value>

                Log level
                <value name="log_level">notice</value>

                When this amount of php processes exited with SIGSEGV or SIGBUS ...
                <value name="emergency_restart_threshold">10</value>

                ... in a less than this interval of time, a graceful restart will be initiated.
                Useful to work around accidental curruptions in accelerator's shared memory.
                <value name="emergency_restart_interval">1m</value>

                Time limit on waiting child's reaction on signals from master
                <value name="process_control_timeout">5s</value>

                Set to 'no' to debug fpm
                <value name="daemonize">yes</value>

        </section>

        <workers>

                <section name="pool">

                        Name of pool. Used in logs and stats.
                        <value name="name">default</value>

                        Address to accept fastcgi requests on.
                        Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
                        <value name="listen_address">127.0.0.1:9000</value>

                        <value name="listen_options">

                                Set listen(2) backlog
                                <value name="backlog">-1</value>

                                Set permissions for unix socket, if one used.
                                In Linux read/write permissions must be set in order to allow connections from web server.
                                Many BSD-derrived systems allow connections regardless of permissions.
                                <value name="owner"></value>
                                <value name="group"></value>
                                <value name="mode">0666</value>
                        </value>

                        Additional php.ini defines, specific to this pool of workers.
                        <value name="php_defines">
                <!--                <value name="sendmail_path">/usr/sbin/sendmail -t -i</value>                -->
                <!--                <value name="display_errors">0</value>                                                                -->
                        </value>

                        Unix user of processes
                        <value name="user">daemon</value>

                        Unix group of processes
                        <value name="group">daemon</value>

                        Process manager settings
                        <value name="pm">

                                Sets style of controling worker process count.
                                Valid values are 'static' and 'apache-like'
                                <value name="style">static</value>

                                Sets the limit on the number of simultaneous requests that will be served.
                                Equivalent to Apache MaxClients directive.
                                Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
                                Used with any pm_style.
                                <value name="max_children">80</value>

                                Settings group for 'apache-like' pm style
                                <value name="apache_like">

                                        Sets the number of server processes created on startup.
                                        Used only when 'apache-like' pm_style is selected
                                        <value name="StartServers">20</value>

                                        Sets the desired minimum number of idle server processes.
                                        Used only when 'apache-like' pm_style is selected
                                        <value name="MinSpareServers">5</value>

                                        Sets the desired maximum number of idle server processes.
                                        Used only when 'apache-like' pm_style is selected
                                        <value name="MaxSpareServers">35</value>

                                </value>

                        </value>

                        The timeout (in seconds) for serving a single request after which the worker process will be terminated
                        Should be used when 'max_execution_time' ini option does not stop script execution for some reason
                        '0s' means 'off'
                        <value name="request_terminate_timeout">120s</value>

                        The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
                        '0s' means 'off'
                        <value name="request_slowlog_timeout">0s</value>

                        The log file for slow requests
                        <value name="slowlog">logs/slow.log</value>

                        Set open file desc rlimit
                        <value name="rlimit_files">51200</value>

                        Set max core size rlimit
                        <value name="rlimit_core">0</value>

                        Chroot to this directory at the start, absolute path
                        <value name="chroot"></value>

                        Chdir to this directory at the start, absolute path
                        <value name="chdir"></value>

                        Redirect workers' stdout and stderr into main error log.
                        If not set, they will be redirected to /dev/null, according to FastCGI specs
                        <value name="catch_workers_output">yes</value>

                        How much requests each process should execute before respawn.
                        Useful to work around memory leaks in 3rd party libraries.
                        For endless request processing please specify 0
                        Equivalent to PHP_FCGI_MAX_REQUESTS
                        <value name="max_requests">10240</value>

                        Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
                        Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
                        Makes sense only with AF_INET listening socket.
                        <value name="allowed_clients">127.0.0.1</value>

                        Pass environment variables like LD_LIBRARY_PATH
                        All $VARIABLEs are taken from current environment
                        <value name="environment">
                                <value name="HOSTNAME">$HOSTNAME</value>
                                <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
                                <value name="TMP">/tmp</value>
                                <value name="TMPDIR">/tmp</value>
                                <value name="TEMP">/tmp</value>
                                <value name="OSTYPE">$OSTYPE</value>
                                <value name="MACHTYPE">$MACHTYPE</value>
                        <value name="MALLOC_CHECK_">2</value>
                        </value>

                </section>

        </workers>

</configuration>



=============================

nginx.conf


user  daemon;
worker_processes  4;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;
worker_rlimit_nofile 65535;
pid        logs/nginx.pid;

events {
    worker_connections  51200;
}

http {
        include       mime.types;
        default_type  application/octet-stream;

        log_format  lu_access_log_1 '$remote_addr --- [$time_local] --- Bytes: $body_bytes_sent --- $request --- $status --- $http_referer';

        log_format  lu_access_log_2 '$remote_addr --- [$time_local] --- Bytes: $body_bytes_sent --- $request --- $status --- $http_referer  --- $http_user_agent --- $http_x_forwarded_for --- $remote_user';

        #access_log  /dev/null  combined;
        #access_log  logs/access.log  main;

        sendfile        on;
        #tcp_nopush     on;

        #keepalive_timeout  0;
        keepalive_timeout  120;

        fastcgi_send_timeout 300;
        fastcgi_connect_timeout 300;
        fastcgi_read_timeout 300;
fastcgi_buffer_size 128k;
fastcgi_buffers 2 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
        server_names_hash_bucket_size 128;

        client_max_body_size 2000M;

        limit_zone   one  $binary_remote_addr  16m;

        gzip on;
        gzip_min_length 1k;
        gzip_buffers 4 8k;
        gzip_http_version 1.1;
        gzip_types text/plain application/x-javascript text/css application/xml;
server {
listen 80 default;
location /{return 400;}
}
        include vhost/*.conf;
}
 楼主| 发表于 2011-7-12 13:25:46 | 显示全部楼层
洞洞快出现吧。。。。还是卡。。
发表于 2011-7-12 14:15:48 | 显示全部楼层
总内存是多少?用了多少?
如果还没有用到80%,可以在套餐中调高cgi进程数
 楼主| 发表于 2011-7-12 16:11:53 | 显示全部楼层
内存使用         1.58 GB         可用内存         395 MB(空闲+可回收)

php_cgi 我调到 80个了。
 楼主| 发表于 2011-7-12 16:13:20 | 显示全部楼层
LuManager 1.0.16 (20110412) 我用的这个版本。。只有无限套餐。
发表于 2011-7-12 16:15:09 | 显示全部楼层
升级成1.1.9,选择国内的镜像
 楼主| 发表于 2011-7-12 23:08:37 | 显示全部楼层
发现点问题了。。服务器上一个 dz 论坛 在线 260 左右就很卡。。在线时间 设置的很长。
发表于 2012-5-25 01:37:55 | 显示全部楼层
用php5.3 开动态phpfpm进程
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|URLOS ( 粤ICP备18087780号 )

GMT+8, 2025-5-15 21:06 , Processed in 0.033194 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表