Example |
The following data script example will print 1 , if there is only one SE present:
-- scale-out SE open connection limit
MAX_OPEN_CON=50
local se_count = avi.vs.se_count()
local open_conn = avi.vs.get_open_conns()
per_se_max = MAX_OPEN_CON/se_count --Dividing the MAX count per SE, assuming equal distribution.
if (open_conn > per_se_max) then
avi.vs.log("Current open conns: " .. open_conn .. "> MAX_OPEN_CON=" .. MAX_OPEN_CON .. " for Total SE: " .. se_count)
avi.http.response(404, {content_type="text/html"}, "<html> MAX_OPEN_CON=" .. MAX_OPEN_CON .. " exceeded, please try later! </html>\n")
else
avi.vs.log("Open conns: " .. open_conn .. " for Total SE: " .. se_count)
end
|