Right now we assume that the minimum number of AppServers per node should be 1, but to support use cases where this isn't the case, we should extract it to a class constant in appscale/AppController/djinn.rb. In particular, the below code should be changed to replace all instances of 1 with the new constant.
if time_since_last_decision > SCALEDOWN_TIME_THRESHOLD and
!@app_info_map[app_name][:appengine].nil? and
appservers_running > 1
Djinn.log_debug("Removing an AppServer on this node for #{app_name}")
remove_appserver_process(app_name)
@last_decision[app_name] = Time.now.to_i
elsif !@app_info_map[app_name][:appengine].nil? and
appservers_running <= 1
Djinn.log_debug("Only 1 AppServer is running - don't kill it")
Right now we assume that the minimum number of AppServers per node should be 1, but to support use cases where this isn't the case, we should extract it to a class constant in appscale/AppController/djinn.rb. In particular, the below code should be changed to replace all instances of
1with the new constant.