• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved 502 bad gateway when any vhost parameter change

solucionesuno

Regular Pleskian
Hello,

When i do any change in the php configuration in one domain all VHOSTS in the server show an "502 bad gateway" For a few seconds.

Also happen creating a new mailbox in any domain, all website show "502 badgateway" for some seconds.

is it normall?


Plesk 17, CENTOS 7. NGINX+APACHE. mod_event.
 
Graceful restart can have some negative side effects, especially on systems where many users frequently update configurations and cause frequent reloading of the web server. From time to time it is a good idea to do real restarts of httpd.
 
A graceful restart is not really a "restart", but a "reload of configuration". It is o.k. to use on a regular basis, but it is also a good idea to remove a service completely from the process list and RAM once in a while and restart it to make sure that occasional errors cannot pile up and orphaned problems won't remain in the system. There is nothing that speaks against using graceful restarts.
 
I can check also in APACHE Configuration there is a field to set a time of restart apache.

acordling documentation

Setting Up the Apache Restart Interval
When users perform operations with domains and subdomains (such as creating, removing, or changing their configurations), the changes take effect only after the restart of Apache.

If you want to avoid too many Apache restarts, you can set a fixed interval of time in which Plesk should restart Apache. Note that if the interval is 0 seconds, Apache restarts immediately after each change. It is recommended to always set this interval to more than 0 seconds, especially if users perform a lot of operations with domains and subdomains through Plesk.

If during the specified interval of time no changes were made with domains, Apache will not restart.

My question is, perhaphs is better idea set this field to controll when apache must restart than use restart_apache_gracefully in datbase?
 

Attachments

  • cFwYfRYAAAAASUVORK5CYII=.png
    cFwYfRYAAAAASUVORK5CYII=.png
    219 KB · Views: 8
Leave the graceful restart in place, but set a server restart interval, too. It is very important to have. Set it to no less than 120 seconds if your server has only a small number of sites and no less than 300 seconds if your server hosts 200+ domains, no less than 900 seconds for 600+ domains. A restart and graceful restart need a certain amount of time. That time becomes longer the more dependency processes are running. The likelihood that a restarts takes a lot of time increases when you have more active websites on the server. A longer restart interval helps to make sure that one restart is completed before another one starts. The problem is, that Plesk does not monitor when a restart finishes, it only waits on the interval to expire, then initializes the next restart if one is needed. This can lead to overlapping restart commands to httpd, which will lead to problems or crashes of the service. So it is better to choose a longer interval than a short interval. Most users are used to waiting a few minutes for web server configuration changes, so that should not have a negative impact on user relations.
 
My server have 100 domains. Sorry am not really sure if i understand how it works this value of time and graceful_restart_value in database together.

of example, If i set this value in 200 seconds.

1) one user do a change in your vhost phph configuration. When apply plesk do a graceful restart of apache to apply configs.
2) Another user do a change:

before 200 seconds > graceful restart
after 200 seconds > standart restart

Is this the working?
 
Plesk simply waits at least the time defined until the next restart is done. If there has not been a previous restart within the interval, a restart will be done immediately. This is independed of graceful or not.

Example:
User A makes a configuration change after a long while of no changes -> Restart executed immediately, because the interval has long expired.
User B makes a configuration change a minute later -> Restart delayed, because the 200 seconds interval has not yet expired.
Both of these restarts are graceful restarts (as you defined it in the Plesk database).
 
Ohh perfect! Now i understand perfect how it works!

this value so is a Threshold for security restart happens together between two users.

Regardless if graceful restart is configured or not.


Many thanks again Peter!
 
Back
Top