I am using YAWS to serve my remote application. When ever there is a change in yaws.conf file i am restarting the server to make these changes in effect. I don't want to do this, because my application might crash if server is down for more than certain time.
So is there a way to load the new configuration file with out stopping the server, like live code update?
You can use the following command from an interactive shell to reload the Yaws config file without restarting the server:
yaws --hup --id ID
where the --id ID
portion is optional — if you're running multiple Yaws instances, it lets you identify which particular Yaws server you want to reload.
There's yaws_api:setconf(GC, SCList), mostly intended for running Yaws "embedded" (i.e., under one of your own supervisors instead of starting Yaws as a separate application). But when you do that, Yaws will still tear down all existing ports and connections in order to set up the new configuration. So the first question is: have you measured the time it takes to restart the whole Yaws application? It might be only slightly slower than reloading the configuration, in which case you would make your code more complicated without really gaining anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With