Browse Source

Change default soft and hard limits

patch-2
Neil Booth 6 years ago
parent
commit
353f26be71
  1. 8
      docs/environment.rst
  2. 4
      electrumx/server/env.py

8
docs/environment.rst

@ -249,8 +249,8 @@ raise them.
.. envvar:: COST_SOFT_LIMIT .. envvar:: COST_SOFT_LIMIT
.. envvar:: COST_HARD_LIMIT .. envvar:: COST_HARD_LIMIT
Session cost soft and hard limits as integers. The default values are :const:`2,000` Session cost soft and hard limits as integers. The default values are :const:`500`
and :const:`20,000` respectively. and :const:`10,000` respectively.
The server prices each request made to it based upon an estimate of the resources needed The server prices each request made to it based upon an estimate of the resources needed
to process it . Factors include whether the request uses bitcoind, how much bandwidth to process it . Factors include whether the request uses bitcoind, how much bandwidth
@ -272,9 +272,9 @@ raise them.
.. envvar:: BANDWIDTH_UNIT_COST .. envvar:: BANDWIDTH_UNIT_COST
The number of bytes, sent and received, by a session that is deemed to cost 1.0. The number of bytes, sent and received, by a session that is deemed to cost :const:`1.0`.
The default value :const:`5000` bytes, meaning the bandwidth cost assigned to a response The default value :const:`5,000` bytes, meaning the bandwidth cost assigned to a response
of 100KB is 20. If your bandwidth is cheap you should probably raise this. of 100KB is 20. If your bandwidth is cheap you should probably raise this.
.. envvar:: SESSION_TIMEOUT .. envvar:: SESSION_TIMEOUT

4
electrumx/server/env.py

@ -68,8 +68,8 @@ class Env(EnvBase):
# Server limits to help prevent DoS # Server limits to help prevent DoS
self.max_send = self.integer('MAX_SEND', self.coin.DEFAULT_MAX_SEND) self.max_send = self.integer('MAX_SEND', self.coin.DEFAULT_MAX_SEND)
self.max_sessions = self.sane_max_sessions() self.max_sessions = self.sane_max_sessions()
self.cost_soft_limit = self.integer('COST_SOFT_LIMIT', 2000) self.cost_soft_limit = self.integer('COST_SOFT_LIMIT', 500)
self.cost_hard_limit = self.integer('COST_HARD_LIMIT', 20000) self.cost_hard_limit = self.integer('COST_HARD_LIMIT', 10000)
self.bw_unit_cost = self.integer('BANDWIDTH_UNIT_COST', 5000) self.bw_unit_cost = self.integer('BANDWIDTH_UNIT_COST', 5000)
self.session_timeout = self.integer('SESSION_TIMEOUT', 600) self.session_timeout = self.integer('SESSION_TIMEOUT', 600)
self.drop_client = self.custom("DROP_CLIENT", None, re.compile) self.drop_client = self.custom("DROP_CLIENT", None, re.compile)

Loading…
Cancel
Save