A brief file description. More...
#include "libts.h"
#include "I_Net.h"
#include "CongestionDB.h"
#include "Congestion.h"
#include "ControlMatcher.h"
#include "ProxyConfig.h"
Go to the source code of this file.
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file Congestion.cc.
#define CONG_RULE_MAX_max_connection_failures (1<<(sizeof(cong_hist_t) * 8)) |
Definition at line 70 of file Congestion.cc.
Referenced by CongestionControlRecord::validate().
#define CONG_RULE_ULIMITED_mac_connection -1 |
Definition at line 74 of file Congestion.cc.
#define CONG_RULE_ULIMITED_max_connection_failures -1 |
Definition at line 73 of file Congestion.cc.
Referenced by CongestionControlRecord::validate().
#define IsGt0 | ( | var | ) |
if ( var < 1 ) { \ error_buf = (char*)ats_malloc(error_len); \ snprintf(error_buf, error_len, "line %d: invalid %s = %d, %s must > 0", \ line_num, #var, var, #var); \ cleanup(); \ return error_buf; \ }
Referenced by CongestionControlRecord::validate().
#define PrintNUM | ( | var | ) | Debug("congestion_config", "%30s = %d", #var, var); |
Referenced by CongestionControlRecord::Print().
#define PrintSTR | ( | var | ) | Debug("congestion_config", "%30s = %s", #var, (var == NULL? "NULL" : var)); |
Referenced by CongestionControlRecord::Print().
#define SERVER_ALLEVIATED_SIG REC_SIGNAL_HTTP_ALLEVIATED_SERVER |
Definition at line 735 of file Congestion.cc.
#define SERVER_CONGESTED_SIG REC_SIGNAL_HTTP_CONGESTED_SERVER |
Definition at line 734 of file Congestion.cc.
static int CongestionControlDefaultSchemeChanged | ( | const char * | , | |
RecDataT | , | |||
RecData | , | |||
void * | ||||
) | [static] |
Definition at line 338 of file Congestion.cc.
References DEFAULT_congestion_scheme, and DEFAULT_congestion_scheme_str.
Referenced by initCongestionControl().
Definition at line 328 of file Congestion.cc.
References congestionControlEnabled, and revalidateCongestionDB().
Referenced by initCongestionControl().
CongestionControlRecord* CongestionControlled | ( | RequestData * | rdata | ) |
Definition at line 418 of file Congestion.cc.
References congestionControlEnabled, ControlMatcher< Data, Result >::Match(), CongestionControlRecord::pRecord, and CongestionControlRule::record.
Referenced by get_congest_entry(), and CongestionEntry::validate().
void init_CongestionRegressionTest | ( | ) |
Definition at line 548 of file CongestionTest.cc.
Referenced by initCongestionControl().
void initCongestionControl | ( | ) |
Definition at line 356 of file Congestion.cc.
References CongestionControlDefaultSchemeChanged(), congestionControlEnabled, CongestionControlEnabledChanged(), congestionControlLocalTime, CongestionControlUpdate, Debug, DEFAULT_client_wait_interval, DEFAULT_congestion_scheme_str, DEFAULT_dead_os_conn_retries, DEFAULT_dead_os_conn_timeout, DEFAULT_error_page, DEFAULT_fail_window, DEFAULT_live_os_conn_retries, DEFAULT_live_os_conn_timeout, DEFAULT_max_connection, DEFAULT_max_connection_failures, DEFAULT_proxy_retry_interval, DEFAULT_wait_interval_alpha, init_CongestionRegressionTest(), ink_assert, REC_EstablishStaticConfigInt32, REC_EstablishStaticConfigStringAlloc, RecData::rec_int, RECD_NULL, CongestionMatcherTable::reconfigure(), RecRegisterConfigUpdateCb(), and register_congest_stats().
Referenced by main().
void initCongestionDB | ( | ) |
Definition at line 434 of file CongestionDB.cc.
uint64_t make_key | ( | char * | hostname, | |
int | len, | |||
sockaddr const * | ip, | |||
char * | prefix, | |||
int | prelen, | |||
short | port | |||
) |
Definition at line 466 of file Congestion.cc.
References ats_ip_addr8_cast(), ats_ip_addr_size(), ink_code_incr_md5_final(), ink_code_incr_md5_init(), and ink_code_incr_md5_update().
uint64_t make_key | ( | char * | hostname, | |
int | len, | |||
sockaddr const * | ip, | |||
CongestionControlRecord * | record | |||
) |
Definition at line 443 of file Congestion.cc.
References ats_ip_addr8_cast(), ats_ip_addr_size(), CongestionControlRecord::congestion_scheme, ink_code_incr_md5_final(), ink_code_incr_md5_init(), ink_code_incr_md5_update(), PER_HOST, CongestionControlRecord::port, CongestionControlRecord::prefix, and CongestionControlRecord::prefix_len.
uint64_t make_key | ( | char * | hostname, | |
sockaddr const * | ip, | |||
CongestionControlRecord * | record | |||
) |
Definition at line 433 of file Congestion.cc.
References make_key().
Referenced by CCCongestionDBTestCont::gen_CongestionEntry(), get_congest_entry(), make_key(), remove_congested_entry(), and CongestionEntry::validate().
const matcher_tags congest_dest_tags [static] |
{ "dest_host", "dest_domain", "dest_ip", NULL, NULL, "host_regex", true }
Definition at line 43 of file Congestion.cc.
Definition at line 37 of file Congestion.cc.
Referenced by register_congest_stats().
int congestionControlEnabled = 0 |
Definition at line 93 of file Congestion.cc.
Referenced by CongestionControlEnabledChanged(), CongestionControlled(), CongestionDBCont::GC(), get_congest_entry(), get_congest_list(), initCongestionControl(), CongestionMatcherTable::reconfigure(), and HttpSM::set_next_state().
int congestionControlLocalTime = 0 |
Definition at line 94 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionEntry::sprint().
ConfigUpdateHandler<CongestionMatcherTable>* CongestionControlUpdate [static] |
Definition at line 92 of file Congestion.cc.
Referenced by initCongestionControl().
CongestionMatcherTable* CongestionMatcher = NULL [static] |
Definition at line 91 of file Congestion.cc.
InkRand CongestionRand(123) |
const char* congestPrefix = "[CongestionControl]" [static] |
Definition at line 41 of file Congestion.cc.
Referenced by CongestionControlRecord::Init(), and CongestionMatcherTable::reconfigure().
int DEFAULT_client_wait_interval = 300 |
Definition at line 59 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_congestion_scheme = PER_IP |
Definition at line 67 of file Congestion.cc.
Referenced by CongestionControlDefaultSchemeChanged(), and CongestionControlRecord::setdefault().
char* DEFAULT_congestion_scheme_str = NULL |
Definition at line 66 of file Congestion.cc.
Referenced by CongestionControlDefaultSchemeChanged(), and initCongestionControl().
int DEFAULT_dead_os_conn_retries = 1 |
Definition at line 64 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_dead_os_conn_timeout = 15 |
Definition at line 63 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
char* DEFAULT_error_page = NULL |
Definition at line 55 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::validate().
int DEFAULT_fail_window = 120 |
Definition at line 57 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_live_os_conn_retries = 2 |
Definition at line 62 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_live_os_conn_timeout = 60 |
Definition at line 61 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_max_connection = -1 |
Definition at line 65 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_max_connection_failures = 5 |
Definition at line 56 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_proxy_retry_interval = 10 |
Definition at line 58 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().
int DEFAULT_wait_interval_alpha = 30 |
Definition at line 60 of file Congestion.cc.
Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().