# Memahami status "overloaded" dan cara mendiagnosisnya

Pada pencarian relay kami memperlihatkan titik merah di samping nama pendek relay saat memiliki muatan yang berlebihan. Ini berarti satu atau lebih metrik beban sudah terpicu:

- Semua invokasi OOM Tor karena tekanan memori
- Semua ntor onionskins dijatuhkan
- Kelelahan port TCP

Ingat jika sebuah relay mencapai keadaan kelebihan beban kami memperlihatkannya sampai 72 jam setelah relay pulih.

Jika Anda melihat relay Anda kelebihan bebas mohon untuk:

1. Mengecek https://status.torproject.org/ untuk berbagai masalah yang telah diketahui dalam kategori "Jaringan Tor".
2. Pertimbangkan tuning `sysctl` untuk sistem Anda untuk jaringan, memori dan beban CPU.
3. Pertimbangkan mengaktifkan `MetricsPort` untuk mengetahui apa yang terjadi.

## Penyetelan `sysctl` untuk jaringan, memori, dan beban CPU

### Kelelahan port TCP

Jika Anda mengalami kelelahan port TCP pertimbangkan untuk mengekspansi range port lokal Anda. Anda bisa melakukan itu dengan

`# sysctl -w net.ipv4.ip_local_port_range="15000 64000"`

atau

`# echo 15000 64000 > /proc/sys/net/ipv4/ip_local_port_range`

Ingat bahwa menyetel `sysctl` seperti yang dijelaskan tidak permanen dan akan hilang setelah pemulaian ulang. Anda perlu menambahkan konfigurasinya ke `/etc/sysctl.conf` atau ke sebuah berkas di dalam `/etc/sysctl.d/` untuk membuatnya permanen.

## MetricsPort

Untuk memahami kesehatan relay-relay Tor dan jaringan Tor, penting untuk menyediakan dan memiliki akses ke metrik-metrik relay. Informasi kelebihan beban relay telah ditambahkan ke deskriptor relay sejak 0.4.6+ namun tidak sampai Tor >= 0.4.7.1-alpha sebuah antar muka untuk metrik di bawahnya tersedia: port metrik.

### Mengaktifkan MetricsPort

Tor memberikan akses ke port metrik melewati opsi konfigurasi torrc yang disebut dengan `MetricsPort`.

Penting untuk memahami bahwa mengekspos MetricsPort tor secara publik itu berbahaya untuk pengguna jaringan Tor, itulah sebabnya port tersebut tidak diaktifkan secara default dan aksesnya perlu diatur dengan aturan akses. Mohon untuk mengambil kewaspadaan dan perhatian ekstra saat membuka port ini, dan tutup jika Anda telah selesai debugging.

Mari berasumsi bahwa Anda adalah satu satunya pengguna pada sebuah server yang menjalankan Tor relay. Anda dapat mengaktifkan port metrik dengan menambahkan ini ke berkas torrc Anda:

    MetricsPort 127.0.0.1:9035
    MetricsPortPolicy accept 127.0.0.1

Dan Anda dapat dengan mudah mendapatkan metriknya dengan:

`# curl http://127.0.0.1:9035/metrics`

yang secara default berada dalam format Prometheus.

Catatan: setiap pengguna pada server tersebut akan dapat mengakses metrik relay di dalam contoh di atas. Secara umum, pasang aturan akses yang sangat ketat dengan `MetricsPortPolicy` dan pertimbangkan menggunakan fitur firewall sistem operasi Anda untuk pertahanan secara mendalam.

Untuk penjelasan lebih lanjut mengenai `MetricsPort` dan `MetricsPortPolicy` lihat laman tor man.

### Output MetricsPort

Berikut ini adalah contoh keluaran yang akan dihasilkan oleh pengaktifan `MetricsPort` (kami tidak menyertakan metrik yang berkaitan dengan kontrol kemacetan karena kami masih perlu menstabilkan antarmuka tersebut):

    # HELP tor_relay_connections Total number of opened connections
    # TYPE tor_relay_connections gauge
    tor_relay_connections{type="OR listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="OR listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="OR listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="OR listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="OR",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="OR",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="OR",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="OR",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Exit",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Exit",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Exit",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Exit",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Socks listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Socks listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Socks listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Socks listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Socks",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Socks",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Socks",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Socks",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Directory listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Directory listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Directory listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Directory listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Directory",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Directory",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Directory",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Directory",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Control listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Control listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Control listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Control listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Control",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Control",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Control",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Control",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Transparent pf/netfilter listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Transparent pf/netfilter listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Transparent pf/netfilter listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Transparent pf/netfilter listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Transparent natd listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Transparent natd listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Transparent natd listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Transparent natd listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="DNS listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="DNS listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="DNS listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="DNS listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Extended OR",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Extended OR",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Extended OR",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Extended OR",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Extended OR listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Extended OR listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Extended OR listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Extended OR listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="HTTP tunnel listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="HTTP tunnel listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="HTTP tunnel listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="HTTP tunnel listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Metrics listener",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Metrics listener",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Metrics listener",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Metrics listener",direction="received",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Metrics",direction="initiated",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Metrics",direction="initiated",state="opened",family="ipv6"} 0
    tor_relay_connections{type="Metrics",direction="received",state="opened",family="ipv4"} 0
    tor_relay_connections{type="Metrics",direction="received",state="opened",family="ipv6"} 0
    # HELP tor_relay_connections_total Total number of created/rejected connections
    # TYPE tor_relay_connections_total counter
    tor_relay_connections_total{type="OR listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="OR listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="OR listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="OR listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="OR listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="OR listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="OR",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="OR",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="OR",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="OR",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="OR",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="OR",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Exit",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Exit",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Exit",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Exit",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Exit",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Exit",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Socks listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Socks listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Socks listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Socks listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Socks listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Socks listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Socks",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Socks",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Socks",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Socks",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Socks",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Socks",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Directory listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Directory listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Directory listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Directory listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Directory listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Directory listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Directory",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Directory",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Directory",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Directory",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Directory",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Directory",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Control listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Control listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Control listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Control listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Control listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Control listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Control",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Control",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Control",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Control",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Control",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Control",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Transparent pf/netfilter listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Transparent pf/netfilter listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Transparent pf/netfilter listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Transparent pf/netfilter listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Transparent pf/netfilter listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Transparent pf/netfilter listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Transparent natd listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Transparent natd listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Transparent natd listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Transparent natd listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Transparent natd listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Transparent natd listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="DNS listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="DNS listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="DNS listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="DNS listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="DNS listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="DNS listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Extended OR",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Extended OR",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Extended OR",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Extended OR",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Extended OR",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Extended OR",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Extended OR listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Extended OR listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Extended OR listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Extended OR listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Extended OR listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Extended OR listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="HTTP tunnel listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="HTTP tunnel listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="HTTP tunnel listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="HTTP tunnel listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="HTTP tunnel listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="HTTP tunnel listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Metrics listener",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Metrics listener",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Metrics listener",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Metrics listener",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Metrics listener",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Metrics listener",direction="received",state="rejected",family="ipv6"} 0
    tor_relay_connections_total{type="Metrics",direction="initiated",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Metrics",direction="initiated",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Metrics",direction="received",state="created",family="ipv4"} 0
    tor_relay_connections_total{type="Metrics",direction="received",state="created",family="ipv6"} 0
    tor_relay_connections_total{type="Metrics",direction="received",state="rejected",family="ipv4"} 0
    tor_relay_connections_total{type="Metrics",direction="received",state="rejected",family="ipv6"} 0
    # HELP tor_relay_flag Relay flags from consensus
    # TYPE tor_relay_flag gauge
    tor_relay_flag{type="Fast"} 0
    tor_relay_flag{type="Exit"} 0
    tor_relay_flag{type="Authority"} 0
    tor_relay_flag{type="Stable"} 0
    tor_relay_flag{type="HSDir"} 0
    tor_relay_flag{type="Running"} 0
    tor_relay_flag{type="V2Dir"} 0
    tor_relay_flag{type="Sybil"} 0
    tor_relay_flag{type="Guard"} 0
    # HELP tor_relay_circuits_total Total number of circuits
    # TYPE tor_relay_circuits_total gauge
    tor_relay_circuits_total{state="opened"} 0
    # HELP tor_relay_streams_total Total number of streams
    # TYPE tor_relay_streams_total counter
    tor_relay_streams_total{type="BEGIN"} 0
    tor_relay_streams_total{type="BEGIN_DIR"} 0
    tor_relay_streams_total{type="RESOLVE"} 0
    # HELP tor_relay_traffic_bytes Traffic related counters
    # TYPE tor_relay_traffic_bytes counter
    tor_relay_traffic_bytes{direction="read"} 0
    tor_relay_traffic_bytes{direction="written"} 0
    # HELP tor_relay_dos_total Denial of Service defenses related counters
    # TYPE tor_relay_dos_total counter
    tor_relay_dos_total{type="circuit_rejected"} 0
    tor_relay_dos_total{type="circuit_killed_max_cell"} 0
    tor_relay_dos_total{type="circuit_killed_max_cell_outq"} 0
    tor_relay_dos_total{type="marked_address"} 0
    tor_relay_dos_total{type="marked_address_maxq"} 0
    tor_relay_dos_total{type="conn_rejected"} 0
    tor_relay_dos_total{type="concurrent_conn_rejected"} 0
    tor_relay_dos_total{type="single_hop_refused"} 0
    tor_relay_dos_total{type="introduce2_rejected"} 0
    # 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
    tor_relay_load_onionskins_total{type="ntor_v3",action="processed"} 0
    tor_relay_load_onionskins_total{type="ntor_v3",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 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{reason="success"} 0
    tor_relay_exit_dns_error_total{reason="format"} 0
    tor_relay_exit_dns_error_total{reason="serverfailed"} 0
    tor_relay_exit_dns_error_total{reason="notexist"} 0
    tor_relay_exit_dns_error_total{reason="notimpl"} 0
    tor_relay_exit_dns_error_total{reason="refused"} 0
    tor_relay_exit_dns_error_total{reason="truncated"} 0
    tor_relay_exit_dns_error_total{reason="unknown"} 0
    tor_relay_exit_dns_error_total{reason="tor_timeout"} 0
    tor_relay_exit_dns_error_total{reason="shutdown"} 0
    tor_relay_exit_dns_error_total{reason="cancel"} 0
    tor_relay_exit_dns_error_total{reason="nodata"} 0
    # 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_socket_total Total number of sockets
    # TYPE tor_relay_load_socket_total gauge
    tor_relay_load_socket_total{state="opened"} 0
    tor_relay_load_socket_total 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_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

Mari mencari tahu apa arti sebenarnya beberapa bari ini:

### tor_relay_load_onionskins_total{type="ntor",action="dropped"} 0

Ketika sebuah relay mulai melihat "dijatuhkan", ini biasanya adalah masalah CPU/RAM.

Sayangnya, Tor hanya berulir tunggal, kecuali saat "kulit onion" diproses. "Onion skins" adalah kerja kriptografis yang perlu dilakukan pada "lapisan onion" yang terkenal di setiap sirkuit.

Saat tor memproses lapisan kami menggunakan thread pool dan melakukan outsource seluruh pekerjaan ke pool tersebut. Ini bisa terjadi bahwa pool ini mulai menjatuhkan pekerjaan karena tekanan memori atau CPU dan ini akan memicu keadaan kelebihan beban.

Jika server Anda sedang berjalan pada kapasitas ini kemungkinan besar akan terpicu.

### tor_relay_exit_dns_error_total{...}

Setiap penghitung dalam ranah "*_dns_error_total" (selain penghitung untuk kueri yang berhasil) mengindikasikan potensi masalah terkait DNS. Namun, kami menyadari selama siklus rilis 0.4.7 bahwa kesalahan DNS terlalu berisik dan mengandung terlalu banyak kesalahan positif sehingga tidak berguna untuk tujuan pelaporan kelebihan beban. Dengan demikian kami tidak lagi menggunakan DNS metrics untuk tujuan itu, dimulai dari 0.4.6.9 dan 0.4.7.4-alpha. Namun, kami masih menggunakan metrik DNS untuk memberikan wawasan bagi operator relay mengenai apa yang sedang terjadi dengan relay mereka.

Masalah batas waktu dan kegagalan DNS hanya berlaku pada node Exit.

### tor_relay_load_oom_bytes_total{...}

Adanya invokasi Out-Of-Memory mengindikasikan gangguan RAM. Relay ini mungkin membutuhkan lebih banyak RAM atau terjadi kebocoran memori. Jika Anda menemukan kebocoran memori dalam proses tor, harap laporkan masalah ini baik melalui Tor GitLab atau kirimkan surel ke milis tor-relays.

Tor memiliki OOM handler sendiri dan diinvokasi saat mencapai 75% dari total memori yang dianggap tersedia. Jadi, katakanlah tor mengira dapat menggunakan total 2GB, maka pada penggunaan memori 1,5GB, tor akan mulai mengosongkan memori. Kondisi tersebut dianggap kelebihan beban.

Untuk memperkirakan jumlah memori yang tersedia, ketika tor dimulai, tor akan menggunakan `MaxMemInQueues` atau, jika tidak disetel, akan melihat total RAM yang tersedia pada sistem dan menerapkan algoritma ini:

    if RAM >= 8GB {
    memory = RAM * 40%
    } else {
    memory = RAM * 75%
    }
    /* Dibatasi. */
    memory = min(memory, 8GB) -> [8GB on 64bit and 2GB on 32bit)
    /* Nilai minimum. */
    memory = max(250MB, memory)

Untuk menghindari kelebihan beban kami menyarankan untuk menjalankan relay di atas 2GB dari RAM pada 64bit. 4GB disarankan, meskipun tentu saja tidak ada salahnya untuk menambahkan lebih banyak RAM jika Anda bisa. Catatan: Jika Anda menjalankan server yang kuat dengan banyak RAM, maka Anda mungkin akan mengalami kondisi kelebihan beban karena batas ukuran antrean default sebesar 8GB, meskipun Anda masih memiliki banyak RAM yang tidak terpakai. Tambahkan entri `MaxMemInQueues` yang sesuai pada konfigurasi `torrc` Anda dalam kasus tersebut.

Orang mungkin memperhatikan bahwa tor dapat dipanggil oleh penangan OOM OS itu sendiri. Karena tor mengambil total memori pada sistem saat dijalankan, jika sistem secara keseluruhan memiliki banyak aplikasi lain yang berjalan menggunakan RAM, maka tor akan memakan terlalu banyak memori. Dalam hal ini OS dapat melakukan OOM tor, tanpa tor bahkan tanpa memperhatikan tekanan memori.

### tor_relay_load_socket_total

Jika jumlah soket yang terbuka mendekati atau sama dengan total soket yang tersedia, maka hal ini mengindikasikan bahwa relay kehabisan soket. Solusinya adalah meningkatkan `ulimit -n` untuk proses tor.

### tor_relay_load_tcp_exhaustion_total

Baris-baris ini mengindikasikan bahwa relay kehabisan port TCP.

Cobalah untuk menyetel `sysctl` seperti yang dijelaskan di atas.

### tor_relay_load_global_rate_limit_reached_total

Jika penghitung ini bertambah dengan nilai yang nyata dalam waktu singkat, relay mengalami kemacetan. Kemungkinan besar digunakan sebagai Guard oleh layanan besar atau untuk DDoS yang sedang berlangsung di jaringan.

Jika relay Anda masih kelebihan beban dan Anda tidak tahu penyebabnya, silakan hubungi network-report@torproject.org. Anda dapat mengenkripsi email Anda menggunakan network-report OpenPGP key.