Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed Jul 24, 2024
1 parent 695c813 commit daf1811
Show file tree
Hide file tree
Showing 4 changed files with 167 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions g3proxy/doc/configuration/user_group/user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,58 @@ Set speed limit for each udp socket.

.. versionchanged:: 1.4.0 changed name to udp_sock_speed_limit

tcp_all_upload_speed_limit
--------------------------

**optional**, **type**: :ref:`global stream speed limit <conf_value_global_stream_speed_limit>`

Set process level upload speed limit for all client side tcp connections.

This will only count in the data that will be forwarded.

**default**: no limit

.. versionadded:: 1.9.5

tcp_all_download_speed_limit
----------------------------

**optional**, **type**: :ref:`global stream speed limit <conf_value_global_stream_speed_limit>`

Set process level download speed limit for all client side tcp connections.

This will only count in the data received from upstream.

**default**: no limit

.. versionadded:: 1.9.5

udp_all_upload_speed_limit
--------------------------

**optional**, **type**: :ref:`global datagram speed limit <conf_value_global_datagram_speed_limit>`

Set process level upload speed limit for all client side udp connections.

This will only count in the data that will be forwarded.

**default**: no limit

.. versionadded:: 1.9.5

udp_all_download_speed_limit
----------------------------

**optional**, **type**: :ref:`global datagram speed limit <conf_value_global_datagram_speed_limit>`

Set process level download speed limit for all client side udp connections.

This will only count in the data received from upstream.

**default**: no limit

.. versionadded:: 1.9.5

tcp_remote_keepalive
--------------------

Expand Down
113 changes: 109 additions & 4 deletions g3proxy/doc/configuration/values/rate_limit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tcp socket speed limit

**yaml value**: mix

It consists of 3 fields:
Basically it consists of 3 fields:

* shift_millis | shift

Expand All @@ -33,7 +33,7 @@ It consists of 3 fields:

This set the max download bytes in the time slice. *0* means delay forever.

The yaml value for *tcp_sock_speed_limit* can be in varies formats:
The yaml value type can be in varies formats:

* :ref:`humanize usize <conf_value_humanize_usize>`

Expand All @@ -50,7 +50,7 @@ udp socket speed limit

**yaml value**: mix

It consists of 4 fields:
Basically it consists of 4 fields:

* shift_millis | shift

Expand Down Expand Up @@ -83,7 +83,7 @@ It consists of 4 fields:

This set the max download packets in the time slice. *0* means no limit.

The yaml value for *udp_sock_speed_limit* can be in varies formats:
The yaml value type can be in varies formats:

* :ref:`humanize usize <conf_value_humanize_usize>`

Expand All @@ -93,6 +93,111 @@ The yaml value for *udp_sock_speed_limit* can be in varies formats:

The keys of this map are the fields as described above.

.. _conf_value_global_stream_speed_limit:

global stream speed limit
=========================

**yaml value**: mix

Basically it consists of 3 fields:

* replenish_interval

**type**: :ref:`humanize duration <conf_value_humanize_duration>`

Set the replenish interval value.

**default**: 1s

* replenish_bytes

**type**: :ref:`humanize usize <conf_value_humanize_usize>`

Set the replenish byte size to add when `replenish_interval` reached.

* max_burst_bytes

**type**: :ref:`humanize usize <conf_value_humanize_usize>`

Set the max byte size.

**default**: the same as `replenish_bytes`

The yaml value type can be in varies formats:

* :ref:`humanize usize <conf_value_humanize_usize>`

This is the same as set `replenish_bytes` to be the same value.

* map

The keys of this map are the fields as described above, and the `replenish_bytes` field is always required.

.. versionadded:: 1.9.5

.. _conf_value_global_datagram_speed_limit:

global datagram speed limit
===========================

**yaml value**: mix

Basically it consists of 5 fields:

* replenish_interval

**optional**, **type**: :ref:`humanize duration <conf_value_humanize_duration>`

Set the replenish interval value.

**default**: 1s

* replenish_bytes

**optional**, **type**: :ref:`humanize usize <conf_value_humanize_usize>`

Set the replenish byte size to add when `replenish_interval` reached.

If not set, no bytes limitation will be applied.

* replenish_packets

**optional**, **type**: :ref:`humanize usize <conf_value_humanize_usize>`

Set the replenish packet count to add when `replenish_interval` reached.

If not set, no packets limitation will be applied.

* max_burst_bytes

**optional**, **type**: :ref:`humanize usize <conf_value_humanize_usize>`

Set the max byte size.

**default**: the same as `replenish_bytes`

* max_burst_packets

**optional**, **type**: :ref:`humanize usize <conf_value_humanize_usize>`

Set the max packet count.

**default**: the same as `replenish_packets`

The yaml value type can be in varies formats:

* :ref:`humanize usize <conf_value_humanize_usize>`

This is the same as set `replenish_bytes` to be the same value.

* map

The keys of this map are the fields as described above,
and at least one of `replenish_bytes` or `replenish_packets` field should be set.

.. versionadded:: 1.9.5

.. _conf_value_request_limit:

request limit
Expand Down
8 changes: 4 additions & 4 deletions g3tiles/doc/configuration/values/rate_limit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tcp socket speed limit

**yaml value**: mix

It consists of 3 fields:
Basically it consists of 3 fields:

* shift_millis | shift

Expand All @@ -33,7 +33,7 @@ It consists of 3 fields:

This set the max download bytes in the time slice. *0* means delay forever.

The yaml value for *tcp_sock_speed_limit* can be in varies formats:
The yaml value type can be in varies formats:

* :ref:`humanize usize <conf_value_humanize_usize>`

Expand All @@ -50,7 +50,7 @@ udp socket speed limit

**yaml value**: mix

It consists of 4 fields:
Basically it consists of 4 fields:

* shift_millis | shift

Expand Down Expand Up @@ -83,7 +83,7 @@ It consists of 4 fields:

This set the max download packets in the time slice. *0* means no limit.

The yaml value for *udp_sock_speed_limit* can be in varies formats:
The yaml value type can be in varies formats:

* :ref:`humanize usize <conf_value_humanize_usize>`

Expand Down

0 comments on commit daf1811

Please sign in to comment.