Commit 7dc66606 authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

feat: add profiling for prysm (#722)

parent cdb20e18
...@@ -15,6 +15,7 @@ DISCOVERY_UDP_PORT_NUM = 12000 ...@@ -15,6 +15,7 @@ DISCOVERY_UDP_PORT_NUM = 12000
RPC_PORT_NUM = 4000 RPC_PORT_NUM = 4000
HTTP_PORT_NUM = 3500 HTTP_PORT_NUM = 3500
BEACON_MONITORING_PORT_NUM = 8080 BEACON_MONITORING_PORT_NUM = 8080
PROFILING_PORT_NUM = 6060
# The min/max CPU/memory that the beacon node can use # The min/max CPU/memory that the beacon node can use
BEACON_MIN_CPU = 100 BEACON_MIN_CPU = 100
...@@ -235,6 +236,11 @@ def get_beacon_config( ...@@ -235,6 +236,11 @@ def get_beacon_config(
{constants.RPC_PORT_ID: public_ports_for_component[3]} {constants.RPC_PORT_ID: public_ports_for_component[3]}
) )
) )
public_ports.update(
shared_utils.get_port_specs(
{constants.PROFILING_PORT_ID: public_ports_for_component[4]}
)
)
used_port_assignments = { used_port_assignments = {
constants.TCP_DISCOVERY_PORT_ID: discovery_port, constants.TCP_DISCOVERY_PORT_ID: discovery_port,
...@@ -242,6 +248,7 @@ def get_beacon_config( ...@@ -242,6 +248,7 @@ def get_beacon_config(
constants.HTTP_PORT_ID: HTTP_PORT_NUM, constants.HTTP_PORT_ID: HTTP_PORT_NUM,
constants.METRICS_PORT_ID: BEACON_MONITORING_PORT_NUM, constants.METRICS_PORT_ID: BEACON_MONITORING_PORT_NUM,
constants.RPC_PORT_ID: RPC_PORT_NUM, constants.RPC_PORT_ID: RPC_PORT_NUM,
constants.PROFILING_PORT_ID: PROFILING_PORT_NUM,
} }
used_ports = shared_utils.get_port_specs(used_port_assignments) used_ports = shared_utils.get_port_specs(used_port_assignments)
...@@ -266,8 +273,11 @@ def get_beacon_config( ...@@ -266,8 +273,11 @@ def get_beacon_config(
# vvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv # vvvvvvvvv METRICS CONFIG vvvvvvvvvvvvvvvvvvvvv
"--disable-monitoring=false", "--disable-monitoring=false",
"--monitoring-host=0.0.0.0", "--monitoring-host=0.0.0.0",
"--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM) "--monitoring-port={0}".format(BEACON_MONITORING_PORT_NUM),
# ^^^^^^^^^^^^^^^^^^^ METRICS CONFIG ^^^^^^^^^^^^^^^^^^^^^ # vvvvvvvvv PROFILING CONFIG vvvvvvvvvvvvvvvvvvvvv
"--pprof",
"--pprofaddr=0.0.0.0",
"--pprofport={0}".format(PROFILING_PORT_NUM),
] ]
# If checkpoint sync is enabled, add the checkpoint sync url # If checkpoint sync is enabled, add the checkpoint sync url
......
...@@ -47,6 +47,7 @@ RPC_PORT_ID = "rpc" ...@@ -47,6 +47,7 @@ RPC_PORT_ID = "rpc"
WS_RPC_PORT_ID = "ws-rpc" WS_RPC_PORT_ID = "ws-rpc"
WS_PORT_ID = "ws" WS_PORT_ID = "ws"
HTTP_PORT_ID = "http" HTTP_PORT_ID = "http"
PROFILING_PORT_ID = "profiling"
VALIDATOR_HTTP_PORT_ID = "http-validator" VALIDATOR_HTTP_PORT_ID = "http-validator"
METRICS_PORT_ID = "metrics" METRICS_PORT_ID = "metrics"
ENGINE_RPC_PORT_ID = "engine-rpc" ENGINE_RPC_PORT_ID = "engine-rpc"
......
...@@ -6,7 +6,7 @@ HTTP_APPLICATION_PROTOCOL = "http" ...@@ -6,7 +6,7 @@ HTTP_APPLICATION_PROTOCOL = "http"
NOT_PROVIDED_APPLICATION_PROTOCOL = "" NOT_PROVIDED_APPLICATION_PROTOCOL = ""
NOT_PROVIDED_WAIT = "not-provided-wait" NOT_PROVIDED_WAIT = "not-provided-wait"
MAX_PORTS_PER_CL_NODE = 4 MAX_PORTS_PER_CL_NODE = 5
MAX_PORTS_PER_EL_NODE = 5 MAX_PORTS_PER_EL_NODE = 5
MAX_PORTS_PER_VC_NODE = 3 MAX_PORTS_PER_VC_NODE = 3
MAX_PORTS_PER_ADDITIONAL_SERVICE = 2 MAX_PORTS_PER_ADDITIONAL_SERVICE = 2
...@@ -290,6 +290,7 @@ def get_port_specs(port_assignments): ...@@ -290,6 +290,7 @@ def get_port_specs(port_assignments):
constants.WS_RPC_PORT_ID, constants.WS_RPC_PORT_ID,
constants.LITTLE_BIGTABLE_PORT_ID, constants.LITTLE_BIGTABLE_PORT_ID,
constants.WS_PORT_ID, constants.WS_PORT_ID,
constants.PROFILING_PORT_ID,
]: ]:
ports.update({port_id: new_port_spec(port, TCP_PROTOCOL)}) ports.update({port_id: new_port_spec(port, TCP_PROTOCOL)})
elif port_id == constants.UDP_DISCOVERY_PORT_ID: elif port_id == constants.UDP_DISCOVERY_PORT_ID:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment