overload.proto 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. syntax = "proto3";
  2. package envoy.config.overload.v3;
  3. import "envoy/type/v3/percent.proto";
  4. import "google/protobuf/any.proto";
  5. import "google/protobuf/duration.proto";
  6. import "udpa/annotations/status.proto";
  7. import "udpa/annotations/versioning.proto";
  8. import "validate/validate.proto";
  9. option java_package = "io.envoyproxy.envoy.config.overload.v3";
  10. option java_outer_classname = "OverloadProto";
  11. option java_multiple_files = true;
  12. option go_package = "github.com/envoyproxy/go-control-plane/envoy/config/overload/v3;overloadv3";
  13. option (udpa.annotations.file_status).package_version_status = ACTIVE;
  14. // [#protodoc-title: Overload Manager]
  15. // The Overload Manager provides an extensible framework to protect Envoy instances
  16. // from overload of various resources (memory, cpu, file descriptors, etc).
  17. // It monitors a configurable set of resources and notifies registered listeners
  18. // when triggers related to those resources fire.
  19. message ResourceMonitor {
  20. option (udpa.annotations.versioning).previous_message_type =
  21. "envoy.config.overload.v2alpha.ResourceMonitor";
  22. reserved 2;
  23. reserved "config";
  24. // The name of the resource monitor to instantiate. Must match a registered
  25. // resource monitor type.
  26. // See the :ref:`extensions listed in typed_config below <extension_category_envoy.resource_monitors>` for the default list of available resource monitor.
  27. string name = 1 [(validate.rules).string = {min_len: 1}];
  28. // Configuration for the resource monitor being instantiated.
  29. // [#extension-category: envoy.resource_monitors]
  30. oneof config_type {
  31. google.protobuf.Any typed_config = 3;
  32. }
  33. }
  34. message ThresholdTrigger {
  35. option (udpa.annotations.versioning).previous_message_type =
  36. "envoy.config.overload.v2alpha.ThresholdTrigger";
  37. // If the resource pressure is greater than or equal to this value, the trigger
  38. // will enter saturation.
  39. double value = 1 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
  40. }
  41. message ScaledTrigger {
  42. // If the resource pressure is greater than this value, the trigger will be in the
  43. // :ref:`scaling <arch_overview_overload_manager-triggers-state>` state with value
  44. // `(pressure - scaling_threshold) / (saturation_threshold - scaling_threshold)`.
  45. double scaling_threshold = 1 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
  46. // If the resource pressure is greater than this value, the trigger will enter saturation.
  47. double saturation_threshold = 2 [(validate.rules).double = {lte: 1.0 gte: 0.0}];
  48. }
  49. message Trigger {
  50. option (udpa.annotations.versioning).previous_message_type =
  51. "envoy.config.overload.v2alpha.Trigger";
  52. // The name of the resource this is a trigger for.
  53. string name = 1 [(validate.rules).string = {min_len: 1}];
  54. oneof trigger_oneof {
  55. option (validate.required) = true;
  56. ThresholdTrigger threshold = 2;
  57. ScaledTrigger scaled = 3;
  58. }
  59. }
  60. // Typed configuration for the "envoy.overload_actions.reduce_timeouts" action. See
  61. // :ref:`the docs <config_overload_manager_reducing_timeouts>` for an example of how to configure
  62. // the action with different timeouts and minimum values.
  63. message ScaleTimersOverloadActionConfig {
  64. enum TimerType {
  65. // Unsupported value; users must explicitly specify the timer they want scaled.
  66. UNSPECIFIED = 0;
  67. // Adjusts the idle timer for downstream HTTP connections that takes effect when there are no active streams.
  68. // This affects the value of :ref:`HttpConnectionManager.common_http_protocol_options.idle_timeout
  69. // <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.idle_timeout>`
  70. HTTP_DOWNSTREAM_CONNECTION_IDLE = 1;
  71. // Adjusts the idle timer for HTTP streams initiated by downstream clients.
  72. // This affects the value of :ref:`RouteAction.idle_timeout <envoy_v3_api_field_config.route.v3.RouteAction.idle_timeout>` and
  73. // :ref:`HttpConnectionManager.stream_idle_timeout
  74. // <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.stream_idle_timeout>`
  75. HTTP_DOWNSTREAM_STREAM_IDLE = 2;
  76. // Adjusts the timer for how long downstream clients have to finish transport-level negotiations
  77. // before the connection is closed.
  78. // This affects the value of
  79. // :ref:`FilterChain.transport_socket_connect_timeout <envoy_v3_api_field_config.listener.v3.FilterChain.transport_socket_connect_timeout>`.
  80. TRANSPORT_SOCKET_CONNECT = 3;
  81. }
  82. message ScaleTimer {
  83. // The type of timer this minimum applies to.
  84. TimerType timer = 1 [(validate.rules).enum = {defined_only: true not_in: 0}];
  85. oneof overload_adjust {
  86. option (validate.required) = true;
  87. // Sets the minimum duration as an absolute value.
  88. google.protobuf.Duration min_timeout = 2;
  89. // Sets the minimum duration as a percentage of the maximum value.
  90. type.v3.Percent min_scale = 3;
  91. }
  92. }
  93. // A set of timer scaling rules to be applied.
  94. repeated ScaleTimer timer_scale_factors = 1 [(validate.rules).repeated = {min_items: 1}];
  95. }
  96. message OverloadAction {
  97. option (udpa.annotations.versioning).previous_message_type =
  98. "envoy.config.overload.v2alpha.OverloadAction";
  99. // The name of the overload action. This is just a well-known string that listeners can
  100. // use for registering callbacks. Custom overload actions should be named using reverse
  101. // DNS to ensure uniqueness.
  102. string name = 1 [(validate.rules).string = {min_len: 1}];
  103. // A set of triggers for this action. The state of the action is the maximum
  104. // state of all triggers, which can be scaling between 0 and 1 or saturated. Listeners
  105. // are notified when the overload action changes state.
  106. repeated Trigger triggers = 2 [(validate.rules).repeated = {min_items: 1}];
  107. // Configuration for the action being instantiated.
  108. google.protobuf.Any typed_config = 3;
  109. }
  110. // Configuration for which accounts the WatermarkBuffer Factories should
  111. // track.
  112. message BufferFactoryConfig {
  113. // The minimum power of two at which Envoy starts tracking an account.
  114. //
  115. // Envoy has 8 power of two buckets starting with the provided exponent below.
  116. // Concretely the 1st bucket contains accounts for streams that use
  117. // [2^minimum_account_to_track_power_of_two,
  118. // 2^(minimum_account_to_track_power_of_two + 1)) bytes.
  119. // With the 8th bucket tracking accounts
  120. // >= 128 * 2^minimum_account_to_track_power_of_two.
  121. //
  122. // The maximum value is 56, since we're using uint64_t for bytes counting,
  123. // and that's the last value that would use the 8 buckets. In practice,
  124. // we don't expect the proxy to be holding 2^56 bytes.
  125. //
  126. // If omitted, Envoy should not do any tracking.
  127. uint32 minimum_account_to_track_power_of_two = 1 [(validate.rules).uint32 = {lte: 56 gte: 10}];
  128. }
  129. message OverloadManager {
  130. option (udpa.annotations.versioning).previous_message_type =
  131. "envoy.config.overload.v2alpha.OverloadManager";
  132. // The interval for refreshing resource usage.
  133. google.protobuf.Duration refresh_interval = 1;
  134. // The set of resources to monitor.
  135. repeated ResourceMonitor resource_monitors = 2 [(validate.rules).repeated = {min_items: 1}];
  136. // The set of overload actions.
  137. repeated OverloadAction actions = 3;
  138. // Configuration for buffer factory.
  139. BufferFactoryConfig buffer_factory_config = 4;
  140. }