Data Structures | Defines | Functions | Variables

Congestion.cc File Reference

A brief file description. More...

#include "libts.h"
#include "I_Net.h"
#include "CongestionDB.h"
#include "Congestion.h"
#include "ControlMatcher.h"
#include "ProxyConfig.h"
Include dependency graph for Congestion.cc:

Go to the source code of this file.

Data Structures

struct  CongestionMatcherTable

Defines

#define CONG_RULE_MAX_max_connection_failures   (1<<(sizeof(cong_hist_t) * 8))
#define CONG_RULE_ULIMITED_max_connection_failures   -1
#define CONG_RULE_ULIMITED_mac_connection   -1
#define IsGt0(var)
#define PrintNUM(var)   Debug("congestion_config", "%30s = %d", #var, var);
#define PrintSTR(var)   Debug("congestion_config", "%30s = %s", #var, (var == NULL? "NULL" : var));
#define SERVER_CONGESTED_SIG   REC_SIGNAL_HTTP_CONGESTED_SERVER
#define SERVER_ALLEVIATED_SIG   REC_SIGNAL_HTTP_ALLEVIATED_SERVER

Functions

void initCongestionDB ()
static int CongestionControlEnabledChanged (const char *, RecDataT, RecData, void *)
static int CongestionControlDefaultSchemeChanged (const char *, RecDataT, RecData, void *)
void init_CongestionRegressionTest ()
void initCongestionControl ()
CongestionControlRecordCongestionControlled (RequestData *rdata)
uint64_t make_key (char *hostname, sockaddr const *ip, CongestionControlRecord *record)
uint64_t make_key (char *hostname, int len, sockaddr const *ip, CongestionControlRecord *record)
uint64_t make_key (char *hostname, int len, sockaddr const *ip, char *prefix, int prelen, short port)

Variables

RecRawStatBlockcongest_rsb
InkRand CongestionRand (123)
static const char * congestPrefix = "[CongestionControl]"
static const matcher_tags congest_dest_tags
char * DEFAULT_error_page = NULL
int DEFAULT_max_connection_failures = 5
int DEFAULT_fail_window = 120
int DEFAULT_proxy_retry_interval = 10
int DEFAULT_client_wait_interval = 300
int DEFAULT_wait_interval_alpha = 30
int DEFAULT_live_os_conn_timeout = 60
int DEFAULT_live_os_conn_retries = 2
int DEFAULT_dead_os_conn_timeout = 15
int DEFAULT_dead_os_conn_retries = 1
int DEFAULT_max_connection = -1
char * DEFAULT_congestion_scheme_str = NULL
int DEFAULT_congestion_scheme = PER_IP
static CongestionMatcherTableCongestionMatcher = NULL
static ConfigUpdateHandler
< CongestionMatcherTable > * 
CongestionControlUpdate
int congestionControlEnabled = 0
int congestionControlLocalTime = 0

Detailed Description

A brief file description.

License

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 Documentation

#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  ) 
Value:
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);
#define PrintSTR (   var  )     Debug("congestion_config", "%30s = %s", #var, (var == NULL? "NULL" : var));
#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.


Function Documentation

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().

static int CongestionControlEnabledChanged ( const char *  ,
RecDataT  ,
RecData  ,
void *   
) [static]

Definition at line 328 of file Congestion.cc.

References congestionControlEnabled, and revalidateCongestionDB().

Referenced by initCongestionControl().

CongestionControlRecord* CongestionControlled ( RequestData rdata  ) 
void init_CongestionRegressionTest (  ) 

Definition at line 548 of file CongestionTest.cc.

Referenced by initCongestionControl().

void initCongestionControl (  ) 
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 
)
uint64_t make_key ( char *  hostname,
int  len,
sockaddr const *  ip,
CongestionControlRecord record 
)
uint64_t make_key ( char *  hostname,
sockaddr const *  ip,
CongestionControlRecord record 
)

Variable Documentation

Initial value:
 {
  "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().

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().

Definition at line 91 of file Congestion.cc.

const char* congestPrefix = "[CongestionControl]" [static]

Definition at line 59 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 66 of file Congestion.cc.

Referenced by CongestionControlDefaultSchemeChanged(), and initCongestionControl().

Definition at line 64 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

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().

Definition at line 57 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 62 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 61 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 65 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 56 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 58 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().

Definition at line 60 of file Congestion.cc.

Referenced by initCongestionControl(), and CongestionControlRecord::setdefault().