nginx causes cpu burst problem when it is received USR1 signal by logrotate script

hakutoitoi nginx-forum at nginx.us
Tue Oct 19 06:34:25 MSD 2010


sorry I mixed up.

configure with --with-http_perl_module
kqueue
configure without --with-http_perl_module
select


I tried simple config file(no use perl syntax)
[code]
$ cat /usr/local/conf/nginx/nginx.conf

user nginx users;
error_log logs/nginx/error  notice;
worker_rlimit_nofile 8192;
worker_processes 32;

pid /usr/local/var/run/nginx.pid;

events {
    worker_connections  1024;
    use kqueue;
    multi_accept off;
}

#include conf.d/*.conf;
[/code]


configure with  --with-http_perl_module
[code]
$ top
  PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU
COMMAND
 1551 root        1   4    0  3760K   664K select 1   3:31  0.00%
syslogd
 1605 root        1   8    0  3700K   432K nanslp 1   1:45  0.00% cron
 1600 root        1   4    0 14020K   952K select 1   0:38  0.00% sshd
52642 root        1   4    0 24928K  2996K sbwait 0   0:00  0.00% sshd
 5953 root        1   4    0  3592K  1916K select 1   0:00  0.00% nginx
 5959 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5979 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5966 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5963 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5972 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5975 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5977 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5954 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5958 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5988 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5976 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5986 nginx       1  96    0  3828K  2140K select 0   0:00  0.00% nginx
 5974 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5981 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5955 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5965 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5957 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5962 nginx       1  96    0  3828K  2132K select 1   0:00  0.00% nginx
 5985 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5961 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5973 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5964 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5968 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5967 nginx       1  96    0  3828K  2132K select 0   0:00  0.00% nginx
 5978 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5983 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5987 nginx       1  96    0  3828K  2140K select 0   0:00  0.00% nginx
 5982 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5970 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5980 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5984 nginx       1  96    0  3828K  2136K select 0   0:00  0.00% nginx
 5971 nginx       1   4    0  3828K  2136K select 1   0:00  0.00% nginx
[/code]


configure without  --with-http_perl_module
[code]
$ top
  PID USERNAME  THR PRI NICE   SIZE    RES STATE  C   TIME   WCPU
COMMAND
 1551 root        1  96    0  3760K   664K select 0   3:31  0.00%
syslogd
 1605 root        1   8    0  3700K   432K nanslp 0   1:45  0.00% cron
 1600 root        1   4    0 14020K   952K select 1   0:38  0.00% sshd
99672 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
52642 root        1   4    0 24928K  2996K sbwait 0   0:00  0.00% sshd
99701 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99695 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99678 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99694 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99707 nginx       1   4    0  2020K  1508K kqread 0   0:00  0.00% nginx
99674 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99692 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99680 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99700 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99687 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99677 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99675 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99688 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99690 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99676 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99702 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99697 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99681 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99673 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99685 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99682 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99699 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99704 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99689 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99691 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99683 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99706 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99693 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99679 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99698 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
99671 root        1  20    0  1796K  1296K pause  0   0:00  0.00% nginx
99703 nginx       1   4    0  2020K  1512K kqread 0   0:00  0.00% nginx
[/code]

If I built nginx with --with-http_perl_module, it seems that nginx uses
select method instead of kqueue.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,141795,142174#msg-142174




More information about the nginx mailing list