Either, nginx+php-fpm bad config or nginx+php-fpm cannot handle high query?

Posted by The Wolf on Server Fault See other posts from Server Fault or by The Wolf
Published on 2014-06-02T21:09:17Z Indexed on 2014/06/02 21:30 UTC
Read the original article Hit count: 363

Filed under:
|
|
|
|

I have wordpress installed in my server configured(hopefully with nginx+php-fpm+mariaDB). I am trying to import using wordpress importer a 1.5MB xml file. Everytime I try to upload it using the importer, it got cut of... meaning just blank screen result..

Here is my error log: actually I just posted 2 of the errors

[error] 858#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xxx.xx.xx, server: xxx.com, request: "GET xxxx.html HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.com"
[error] 858#0: *13 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.x.xx.xx, server: xxx.com, request: "GET xxxx.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.com"

I don't know what is the reason why it can't process the wordpress export .xml. I already increased max_file_upload & etc., but nothing happens. Hope somebody can help me.

Here are my conf:

nginx.conf

user  nginx;
worker_processes  8;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


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

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;
    server_tokens off;
    keepalive_timeout  65;
    fastcgi_read_timeout 500;

    #gzip  on;
    client_max_body_size 2M;

php-fpm.conf

;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;

; All relative paths in this configuration file are relative to PHP's install
; prefix.

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
include=/etc/php-fpm.d/*.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;

[global]
; Pid file
; Default Value: none
pid = /var/run/php-fpm/php-fpm.pid

; Error log file
; Default Value: /var/log/php-fpm.log
error_log = /var/log/php-fpm/error.log

; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
;log_level = notice

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
;emergency_restart_threshold = 0

; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated.  This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;emergency_restart_interval = 0

; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;process_control_timeout = 0

; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
daemonize = no

;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;

; See /etc/php-fpm.d/*.conf

[root@host etc]# vim php-fpm.conf
[root@host etc]# vim php-fpm.conf
; Default Value: notice
;log_level = notice

; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
;emergency_restart_threshold = 0

; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated.  This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;emergency_restart_interval = 0

; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
;process_control_timeout = 0

; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
daemonize = no

;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;

; See /etc/php-fpm.d/*.conf

ps aux

[root@host etc]# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.1   2900  1380 ?        Ss   Jun02   0:00 init
root         2  0.0  0.0      0     0 ?        S    Jun02   0:00 [kthreadd/9308]
root         3  0.0  0.0      0     0 ?        S    Jun02   0:00 [khelper/9308]
root       124  0.0  0.0   2464   576 ?        S<s  Jun02   0:00 /sbin/udevd -d
root       460  0.0  0.1  35976  1308 ?        Sl   Jun02   0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
root       474  0.0  0.0   8940  1028 ?        Ss   Jun02   0:00 /usr/sbin/sshd
root       481  0.0  0.0   3264   876 ?        Ss   Jun02   0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
root       491  0.0  0.1   6268  1432 ?        S    Jun02   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/host.busilak.com.
mysql      584  0.1  6.8 679072 71456 ?        Sl   Jun02   0:04 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --use
root       586  0.0  0.3  12008  3820 ?        Ss   Jun02   0:01 sshd: root@pts/0
root       629  0.0  0.0   9140   756 ?        Ss   Jun02   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
root       630  0.0  0.0   9140   520 ?        S    Jun02   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam -n 2
root       645  0.0  0.1  12788  1928 ?        Ss   Jun02   0:01 sendmail: accepting connections
smmsp      653  0.0  0.1  12576  1728 ?        Ss   Jun02   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root       691  0.0  0.1   7148  1184 ?        Ss   Jun02   0:00 crond
root       698  0.0  0.1   6272  1688 pts/0    Ss   Jun02   0:00 -bash
root      1006  0.0  0.0   7828   924 ?        Ss   00:30   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx     1007  0.0  0.1   8156  1724 ?        S    00:30   0:00 nginx: worker process
nginx     1008  0.0  0.1   8024  1360 ?        S    00:30   0:00 nginx: worker process
nginx     1009  0.0  0.1   8020  1356 ?        S    00:30   0:00 nginx: worker process
nginx     1011  0.0  0.1   8024  1360 ?        S    00:30   0:00 nginx: worker process
nginx     1012  0.0  0.1   8024  1360 ?        S    00:30   0:00 nginx: worker process
nginx     1013  0.0  0.1   8024  1360 ?        S    00:30   0:00 nginx: worker process
nginx     1014  0.0  0.1   8024  1360 ?        S    00:30   0:00 nginx: worker process
nginx     1015  0.0  0.1   8024  1344 ?        S    00:30   0:00 nginx: worker process
root      1030  0.0  0.2  25396  2904 ?        Ss   00:30   0:00 php-fpm: master process (/etc/php-fpm.conf)
apache    1031  0.0  1.9  40700 20624 ?        S    00:30   0:00 php-fpm: pool www
apache    1032  0.0  2.0  41924 21888 ?        S    00:30   0:01 php-fpm: pool www
apache    1033  0.0  1.9  41212 20848 ?        S    00:30   0:01 php-fpm: pool www
apache    1034  0.0  1.9  40956 20792 ?        S    00:30   0:01 php-fpm: pool www
apache    1035  0.0  2.0  41560 21556 ?        S    00:30   0:02 php-fpm: pool www
apache    1040  0.0  1.8  39292 19120 ?        S    00:30   0:00 php-fpm: pool www
root      1125  0.0  0.0   6080  1040 pts/0    R+   01:04   0:00 ps aux

netstat -l

[root@host etc]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 *:ssh                       *:*                         LISTEN
tcp        0      0 localhost.localdomain:smtp  *:*                         LISTEN
tcp        0      0 localhost.locald:cslistener *:*                         LISTEN
tcp        0      0 *:mysql                     *:*                         LISTEN
tcp        0      0 *:http                      *:*                         LISTEN
tcp        0      0 *:ssh                       *:*                         LISTEN
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node Path
unix  2      [ ACC ]     STREAM     LISTENING     60575947 /var/run/saslauthd/mux
unix  2      [ ACC ]     STREAM     LISTENING     60574168 @/com/ubuntu/upstart
unix  2      [ ACC ]     STREAM     LISTENING     60575873 /var/lib/mysql/mysql.sock

Hope somebody can help me to figure out what is the problem.

© Server Fault or respective owner

Related posts about nginx

Related posts about centos6