On relay search we show an amber dot next to the relay nickname when it is overloaded.
Esto significa que una o muchas de las siguientes métricas de carga han sido desencadenadas:
Ten en cuenta que si un repetidor alcanza un estado de sobrecarga lo mostramos por 72 horas luego de que el repetidor se haya resuperado.
Si notas que tu repetidor está sobrecargado, por favor:
Comprueba https://status.torproject.org/ por cualquier dificultad conocida en la categoría "red Tor".
Considera sintonizar sysctl
para tu sistema para las cargas de red, memoria y CPU.
Considera habilitar MetricsPort
para entender qué está pasando.
Sintonizando sysctl
para cargas de red, memoria y CPU
Agotamiento de puertos TCP
Si estás experimentando agotamiento de puertos TCP considera expandir tu rango de puertos locales.
Puedes hacer eso con
# sysctl -w net.ipv4.ip_local_port_range="15000 64000"
o
# echo 15000 64000 > /proc/sys/net/ipv4/ip_local_port_range
Keep in mind that tuning sysctl
as described is not permanent and will be lost upon restart.
You need to add the configuration to /etc/sysctl.conf
or to a file in /etc/sysctl.d/
to make it permanent.
MetricsPort
To understand the well-being of Tor relays and the Tor network it is vital to provide and have access to relay metrics.
Relay overload information has been added to relay descriptors since 0.4.6+ but it was not until Tor >= 0.4.7.1-alpha that an interface to the underlying relay metrics was available: the metrics port.
Enabling MetricsPort
Tor provides access to the metrics port via a torrc configuration option called MetricsPort
.
It's important to understand that exposing the tor MetricsPort publicly is dangerous for the Tor network users, which is why that port is not enabled by default and its access has to be governed by an access policy.
Por favor, toma precaución y cuidado extras al abrir este puerto, y ciérralo cuando hayas finalizado la depuración de errores.
Let's assume you are the only user on a server that runs a Tor relay.
You can enable the metrics port adding this to your torrc file:
MetricsPort 127.0.0.1:9035
MetricsPortPolicy accept 127.0.0.1
And then you will be able to easily retrieve the metrics with:
# curl http://127.0.0.1:9035/metrics
which are by default in a Prometheus format.
Note: every user on that server will be able to access those relay metrics in the example above.
In general, set a very strict access policy with MetricsPortPolicy
and consider using your operating systems firewall features for defense in depth.
For a more detailed explanation about MetricsPort
and MetricsPortPolicy
see tor's man page.
MetricsPort output
He aquí un ejemplo de qué salida producirá la habilitación de MetricsPort
:
# HELP tor_relay_load_onionskins_total Total number of onionskins handled
# TYPE tor_relay_load_onionskins_total counter
tor_relay_load_onionskins_total{type="tap",action="processed"} 0
tor_relay_load_onionskins_total{type="tap",action="dropped"} 0
tor_relay_load_onionskins_total{type="fast",action="processed"} 0
tor_relay_load_onionskins_total{type="fast",action="dropped"} 0
tor_relay_load_onionskins_total{type="ntor",action="processed"} 0
tor_relay_load_onionskins_total{type="ntor",action="dropped"} 0
# HELP tor_relay_exit_dns_query_total Total number of DNS queries done by this relay
# TYPE tor_relay_exit_dns_query_total counter
tor_relay_exit_dns_query_total{record="A"} 0
tor_relay_exit_dns_query_total{record="PTR"} 0
tor_relay_exit_dns_query_total{record="AAAA"} 0
# HELP tor_relay_exit_dns_error_total Total number of DNS errors encountered by this relay
# TYPE tor_relay_exit_dns_error_total counter
tor_relay_exit_dns_error_total{record="A",reason="success"} 0
tor_relay_exit_dns_error_total{record="A",reason="format"} 0
tor_relay_exit_dns_error_total{record="A",reason="serverfailed"} 0
tor_relay_exit_dns_error_total{record="A",reason="notexist"} 0
tor_relay_exit_dns_error_total{record="A",reason="notimpl"} 0
tor_relay_exit_dns_error_total{record="A",reason="refused"} 0
tor_relay_exit_dns_error_total{record="A",reason="truncated"} 0
tor_relay_exit_dns_error_total{record="A",reason="unknown"} 0
tor_relay_exit_dns_error_total{record="A",reason="tor_timeout"} 0
tor_relay_exit_dns_error_total{record="A",reason="shutdown"} 0
tor_relay_exit_dns_error_total{record="A",reason="cancel"} 0
tor_relay_exit_dns_error_total{record="A",reason="nodata"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="success"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="format"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="serverfailed"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="notexist"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="notimpl"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="refused"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="truncated"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="unknown"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="tor_timeout"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="shutdown"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="cancel"} 0
tor_relay_exit_dns_error_total{record="PTR",reason="nodata"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="success"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="format"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="serverfailed"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="notexist"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="notimpl"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="refused"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="truncated"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="unknown"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="tor_timeout"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="shutdown"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="cancel"} 0
tor_relay_exit_dns_error_total{record="AAAA",reason="nodata"} 0
# HELP tor_relay_load_tcp_exhaustion_total Total number of times we ran out of TCP ports
# TYPE tor_relay_load_tcp_exhaustion_total counter
tor_relay_load_tcp_exhaustion_total 0
# HELP tor_relay_load_socket_total Total number of sockets
# TYPE tor_relay_load_socket_total gauge
tor_relay_load_socket_total{state="opened"} 135
tor_relay_load_socket_total 1048544
# HELP tor_relay_load_oom_bytes_total Total number of bytes the OOM has freed by subsystem
# TYPE tor_relay_load_oom_bytes_total counter
tor_relay_load_oom_bytes_total{subsys="cell"} 0
tor_relay_load_oom_bytes_total{subsys="dns"} 0
tor_relay_load_oom_bytes_total{subsys="geoip"} 0
tor_relay_load_oom_bytes_total{subsys="hsdir"} 0
# HELP tor_relay_load_global_rate_limit_reached_total Total number of global connection bucket limit reached
# TYPE tor_relay_load_global_rate_limit_reached_total counter
tor_relay_load_global_rate_limit_reached_total{side="read"} 0
tor_relay_load_global_rate_limit_reached_total{side="write"} 0
Descubramos qué significan realmente algunas de estas líneas:
tor_relay_load_onionskins_total{type="ntor",action="dropped"} 0
Cuando un repetidor empieza a ser visto "caído", usualmente es un problema de CPU/RAM.
Tristemente, Tor se ejecuta en instancia única excepto cuando son procesadas las "pieles de cebolla".
Las "pieles de cebolla" son el trabajo criptográfico que necesita ser hecho en las famosas "capas de cebolla" en cada circuito.
Cuando tor procesa las capas usamos una reserva de instancias, y le damos todo ese trabajo a esa reserva.
Puede pasar que esta reserva empiece a descartar trabajos debido a presión en la memoria o la CPU, y esto desencadenará un estado de sobrecarga.
Si tu servidor se está ejecutando a capacidad, probablemente esto será desencadenado.
tor_relay_exit_dns_error_total{...}
Any counter in the "*_dns_error_total" realm indicates a potential DNS related problem.
However, we realized during the 0.4.7 release cycle that DNS errors are way too noisy and contain too many false positives to be useful for overload reporting purposes.
We therefore don't use them anymore for that purpose starting with 0.4.6.9 and 0.4.7.4-alpha. However, we still keep DNS metrics around to give the relay operator insight into what is going on with their relay.
DNS timeout issues and errors only apply to Exit nodes.
tor_relay_load_oom_bytes_total{...}
Una invocación de memoria agotada indica un problema con la RAM.
El repetidor podría necesitar más RAM o está filtrando memoria.
Si notaste que el proceso tor está filtrando memoria, por favor informa esta dificultad vía el gitLab de Tor o bien enviando un correo electrónico a la lista de correo tor-relays.
Tor tiene su propio manejador OOM, y es invocado cuando el 75% de la memoria total que tor piensa que está disponible es alcanzado.
Por lo tanto, digamos que tor piensa que puede usar 2GB en total, luego, a 1.5GB de uso de memoria, empezará a liberarla.
Ese es considerado un estado de sobrecarga.
Para estimar la cantidad de memoria que tiene disponible, cuando tor se inicia usará MaxMemInQueues, o, si no está establecido, mirará al total de RAM disponible en el sistema y aplicará este algoritmo:
if RAM >= 8GB {
memoria = RAM * 40%
} else {
memoria = RAM * 75%
}
/* Límite alcanzado. */
memoria = min(memoria, 8GB) -> [8GB en 64bit y 2GB en 32bit)
/* Valor mínimo. */
memoria = max(250MB, memoria)
Para evitar un estado sobrecargado, recomendamos ejecutar un repatidor por sobre 2GB de RAM en 64bit.
4GB es aconsejado, sin embargo, por supuesto, no causa daño agregar más RAM si puedes.
Uno podría notar que tor podría ser llamado por el manejador OOM del SO propiamente dicho.
Como tor toma la memoria total en el sistema cuando se inicia, si el sistema en general tiene muchas otras aplicaciones ejecutándose usando RAM, termina consumiendo demasiada memoria.
En este caso el SO podría hacerle un OOM a tor, sin que este ni siquiera note la presión en la memoria.
tor_relay_load_socket_total
Estas líneas indican que el repetidor está quedándose sin sockets.
La solución es incrementar ulimit -n
para el proceso tor.
tor_relay_load_tcp_exhaustion_total
Estas líneas indican que el repetidor está quedándose sin puertos TCP.
Intenta sintonizar sysctl
como se describió arriba.
tor_relay_load_global_rate_limit_reached_total
Si este contador es incrementado en algún valor notable sobre un periodo de tiempo corto, el repetidor está congestionado.
Probablemente esté siendo usado como Guardián por un servicio cebolla grande o por un ataque DDoS ocurriendo sobre la red.
Si tu repetidor aún está sobrecargado y no sabes por qué, por favor contáctate con network-report@torproject.org.
Puedes cifrar tu correo electrónico usando la clave OpenPGP de network-report.