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

shafie

Verified User
Joined
Jan 9, 2012
Messages
14
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?
 
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 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
 
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?
 
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
 
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,

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
 
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
 
Please check if you still experience problems with DA 1.44.1.
 
Back
Top