Results 1 to 11 of 11

Thread: Nginx stops during 1 minute and after other 1 minute it runs again

  1. #1
    Join Date
    Jan 2012
    Posts
    14

    Nginx stops during 1 minute and after other 1 minute it runs again

    Current settings: CB2+Nginx+PHP-FPM

    In this server I have many users, and every user has many sites.
    If any user do any task that could do an "nginx reload" such protecting a directory, or adding new site ...etc. the server after 1 minute stops, that means I can't access any web. And after 1 minute the server wakes up, and it starts serving all the webs hosted in it.

    I have seen le error_log of nginx but I don't find any message regards the issue

    Any clue?

  2. #2
    Join Date
    Jan 2012
    Posts
    14
    ConfigServer Security & Firewall http://configserver.com/cp/csf.html is installed in the same server. Could this cause this behaviour?

  3. #3
    Join Date
    Jul 2005
    Posts
    2,007
    No it has to reload the config anytime anything changes. Apache has graceful restarts but I dont know anything about nginx.

    Do you have this line in /usr/local/directadmin/conf/directadmin.conf

    graceful_restarts=1

  4. #4
    Join Date
    Jan 2012
    Posts
    14
    Quote Originally Posted by chatwizrd View Post
    No it has to reload the config anytime anything changes. Apache has graceful restarts but I dont know anything about nginx.

    Do you have this line in /usr/local/directadmin/conf/directadmin.conf

    graceful_restarts=1
    No I don't

  5. #5
    Join Date
    Jan 2012
    Posts
    14
    Confirmed, every time I add a new domain, subdomain or protect a directory, by some reason it "restart" all users nginx config files, and the nginx process iskilled and started again.

    For example, before adding a new domain I execute the command ps:
    Code:
    # ps aux | grep nginx
    root     12330  0.0  0.0  63120  9948 ?        Ss   00:12   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
    nginx    12331  0.0  0.0  63840 12236 ?        S    00:12   1:04 nginx: worker process                   
    nginx    12332  0.0  0.0  63840 12296 ?        S    00:12   1:12 nginx: worker process                   
    nginx    12333  0.0  0.0  63840 12324 ?        S    00:12   1:09 nginx: worker process                   
    nginx    12335  0.0  0.0  63744 12288 ?        S    00:12   1:11 nginx: worker process
    After adding the domain
    Code:
    # ps aux | grep nginx
    root     12330  0.0  0.0  63120 10060 ?        Ss   Sep11   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
    nginx    12332  0.0  0.0  63840 12296 ?        S    Sep11   1:13 nginx: worker process is shutting down  
    nginx    12333  0.0  0.0  63840 12324 ?        S    Sep11   1:10 nginx: worker process is shutting down
    Some seconds after there is no nginx process, and after some seconds more all is online again like the intial stage.
    Perhaps the whole process may last a couple of minutes, but this mean the server is down during o couple of minutes.

    Any clue?

  6. #6
    Join Date
    Jun 2013
    Posts
    71
    close to my problem
    but i have nginx stop working for more than 1 minute , actually for ever until i kill process and Restart it

    also my problem is this happen every day on a specific time

  7. #7
    Hello,

    The daily restart is likely with the tally..
    So the issue seems like it's just the time it takes to fully stop nginx (to disconnect all clients) and restart again.

    The graceful option might be a good choice here, as nginx never really goes offline, but does eventually fully restart.

    Add:
    Code:
    graceful_restarts=1
    to your directadmin.conf, and restart DA.
    Confirm it's set correctly:
    Code:
    cd /usr/local/directadmin
    ./directadmin c | grep graceful_restarts
    Note that there is an option to skip the post-tally restart, but we don't recommend using it.
    The graceful should be sufficient.

    John

  8. #8
    Join Date
    Jun 2013
    Posts
    71
    Quote Originally Posted by DirectAdmin Support View Post
    Hello,

    The daily restart is likely with the tally..
    So the issue seems like it's just the time it takes to fully stop nginx (to disconnect all clients) and restart again.

    The graceful option might be a good choice here, as nginx never really goes offline, but does eventually fully restart.

    Add:
    Code:
    graceful_restarts=1
    to your directadmin.conf, and restart DA.
    Confirm it's set correctly:
    Code:
    cd /usr/local/directadmin
    ./directadmin c | grep graceful_restarts
    Note that there is an option to skip the post-tally restart, but we don't recommend using it.
    The graceful should be sufficient.

    John

    Hello John
    thanks for reply
    i added graceful_restarts=1 to directadmin.conf

    yesterday i realize that if leave server alone after nginx stopped working ( service status is "nginx: worker process is shutting down" ) after about 40~60min server start to serving request again
    the server is working as file download server ( download hosting)

    after i added greaceful_restart i tried to restart nginx with

    service nginx restart

    but the result is that nginx not restarted and just changed state to

    "nginx: worker process is shutting down"

    i need to run killall -9 nginx and then restart nginx

    and i think i will have another downtime next morning ! becuase nothing changed

  9. #9
    Join Date
    Jan 2012
    Posts
    14
    Quote Originally Posted by DirectAdmin Support View Post
    Hello,

    The daily restart is likely with the tally..
    So the issue seems like it's just the time it takes to fully stop nginx (to disconnect all clients) and restart again.

    The graceful option might be a good choice here, as nginx never really goes offline, but does eventually fully restart.

    Add:
    Code:
    graceful_restarts=1
    to your directadmin.conf, and restart DA.
    Confirm it's set correctly:
    Code:
    cd /usr/local/directadmin
    ./directadmin c | grep graceful_restarts
    Note that there is an option to skip the post-tally restart, but we don't recommend using it.
    The graceful should be sufficient.

    John
    No way, still shutting down nginx and start it again

  10. #10
    Join Date
    Jan 2012
    Posts
    14
    Any help on this problem?

  11. #11
    Join Date
    Aug 2006
    Location
    LT, EU
    Posts
    7,396
    Please check if you still experience problems with DA 1.44.1.
    Martynas Bendorius
    MB Martynas IT. Professional server management company. Official DirectAdmin, CloudLinux, LiteSpeed and Comodo partners.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •