nf_conntrack_tuple_taken 100% cpu
Привет всем! Прошу помощи и совета. Есть Nat/маршрутизатор на Debian. Почти каждый день сервер в разное время ложится в полку по cpu, через некоторое время 10-50мин. его попускает. perf top выявил в этот момент nf_conntrack_tuple_taken 100%. Проц i7-7700. Сетевая Intel I350-t4
Заранее спасибо за любые советы.
~# uname -r
4.9.0-3-amd64
# iptables -V
iptables v1.6.0
# ipset -v
ipset v6.30, protocol version: 6
# sysctl -a | grep conntrack
net.netfilter.nf_conntrack_acct = 0
net.netfilter.nf_conntrack_buckets = 409600
net.netfilter.nf_conntrack_checksum = 1
net.netfilter.nf_conntrack_count = 722614
net.netfilter.nf_conntrack_events = 1
net.netfilter.nf_conntrack_expect_max = 256
net.netfilter.nf_conntrack_generic_timeout = 600
net.netfilter.nf_conntrack_helper = 0
net.netfilter.nf_conntrack_icmp_timeout = 30
net.netfilter.nf_conntrack_log_invalid = 0
net.netfilter.nf_conntrack_max = 1638400
net.netfilter.nf_conntrack_tcp_be_liberal = 0
net.netfilter.nf_conntrack_tcp_loose = 1
net.netfilter.nf_conntrack_tcp_max_retrans = 3
net.netfilter.nf_conntrack_tcp_timeout_close = 10
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_established = 600
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_last_ack = 30
net.netfilter.nf_conntrack_tcp_timeout_max_retrans = 300
net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 60
net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 120
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_unacknowledged = 300
net.netfilter.nf_conntrack_timestamp = 0
net.netfilter.nf_conntrack_udp_timeout = 30
net.netfilter.nf_conntrack_udp_timeout_stream = 180
net.nf_conntrack_max = 1638400
# iptables-save
# Generated by iptables-save v1.6.0 on Thu Oct 26 20:20:05 2017
*mangle
:PREROUTING ACCEPT [8049016415:5035799096738]
:INPUT ACCEPT [20556383:1399056353]
:FORWARD ACCEPT [8010527052:5033150314691]
:OUTPUT ACCEPT [5970982:315886365]
:POSTROUTING ACCEPT [8011579861:5033182613315]
:balance - [0:0]
:new_conn - [0:0]
-A PREROUTING -m conntrack --ctstate NEW -j new_conn
-A PREROUTING -j CONNMARK --restore-mark --nfmask 0xffffffff --ctmask 0xffffffff
-A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-A balance -m statistic --mode random --probability 0.50000000000 -j SET --add-set vlan2000 src
-A balance -m set --match-set uplink_list src -j RETURN
-A balance -m statistic --mode random --probability 1.00000000000 -j SET --add-set vlan2001 src
-A new_conn -m set --match-set ip_pools src -m set ! --match-set uplink_list src -j balance
-A new_conn -m set --match-set vlan2000 src -j CONNMARK --set-xmark 0x1/0xffffffff
-A new_conn -m set --match-set vlan2001 src -j CONNMARK --set-xmark 0x2/0xffffffff
-A new_conn -m set --match-set vlan2000 src -j SET --add-set vlan2000 src --exist
-A new_conn -m set --match-set vlan2001 src -j SET --add-set vlan2001 src --exist
COMMIT
# Completed on Thu Oct 26 20:20:05 2017
# Generated by iptables-save v1.6.0 on Thu Oct 26 20:20:05 2017
*filter
:INPUT DROP [19591862:1326290389]
:FORWARD ACCEPT [8005609010:5032866794927]
:OUTPUT ACCEPT [5970955:315883993]
:input_check - [0:0]
:input_new - [0:0]
-A INPUT -m conntrack --ctstate INVALID -j DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate NEW -j input_new
-A FORWARD -p tcp -m set --match-set blacklist dst -j REJECT --reject-with tcp-reset
-A FORWARD -m set --match-set blacklist dst -j REJECT --reject-with icmp-port-unreachable
-A input_check -m recent --update --seconds 600 --hitcount 3 --name DEFAULT --mask 255.255.255.255 --rsource -j LOG --log-prefix "iptables INPUT bruteforce: "
-A input_check -m recent --update --seconds 600 --hitcount 3 --name DEFAULT --mask 255.255.255.255 --rsource -j DROP
-A input_check -m recent --set --name DEFAULT --mask 255.255.255.255 --rsource -j ACCEPT
-A input_new -p tcp -m tcp --dport 62222 -j input_check
-A input_new -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A input_new -m set --match-set input_src src -j ACCEPT
COMMIT
# Completed on Thu Oct 26 20:20:05 2017
# Generated by iptables-save v1.6.0 on Thu Oct 26 20:20:05 2017
*nat
:PREROUTING ACCEPT [731335048:51842951878]
:INPUT ACCEPT [19609:2145677]
:OUTPUT ACCEPT [112016:5944261]
:POSTROUTING ACCEPT [4985233:199144045]
:dnat_post - [0:0]
:dnat_pre - [0:0]
-A PREROUTING -d x.x.x.x -m set --match-set dnat_ports dst -j dnat_pre
-A OUTPUT -d x.x.x.x -m set --match-set dnat_ports dst -j dnat_pre
-A POSTROUTING -m set --match-set ip_pools src -m set --match-set dnat_ports dst -j dnat_post
-A POSTROUTING -o vlan2001 -j SNAT --to-source x.x.x.x-x.x.x.x --persistent
-A POSTROUTING -o vlan2000 -j SNAT --to-source x.x.x.x-x.x.x.x --persistent
-A dnat_post -d 172.19.0.1/32 -p udp -m multiport --dports 80,443 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 172.19.0.1/32 -p tcp -m multiport --dports 80,443 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.123.7/32 -p tcp -m multiport --dports 6036,6037,6038,6039 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.126.9/32 -p tcp -m multiport --dports 50001,50002 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.10/32 -p tcp -m multiport --dports 50004,50005 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.166/32 -p tcp -m multiport --dports 50006,50007 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.166/32 -p udp -m multiport --dports 50006,50007 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.156/32 -p tcp -m multiport --dports 50008,50029 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.41/32 -p tcp -m multiport --dports 50009,50010,50012 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.41/32 -p tcp -m multiport --dports 80 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.180/32 -p tcp -m multiport --dports 50014,50015,50050 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.130/32 -p tcp -m multiport --dports 50016,50017,50025 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.181/32 -p tcp -m multiport --dports 50027,50028 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.126.7/32 -p tcp -m multiport --dports 50029,50030,50031,50032 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.216/32 -p tcp -m multiport --dports 50033,50034,50035,50036 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.1.223/32 -p tcp -m multiport --dports 50037,50038 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.1.253/32 -p tcp -m multiport --dports 50039,50040,50041,50042,50043,50044,50045,50046,50047,50048,50049 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.2.8/32 -p tcp -m multiport --dports 50050,50051,50054 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.2.9/32 -p tcp -m multiport --dports 50052,50053 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.1.2/32 -p tcp -m multiport --dports 50055,50056,50057,50058,50059,50060,50061,50062,50063,50064,50065 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 172.20.0.100/32 -p tcp -m multiport --dports 80 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 172.20.0.101/32 -p tcp -m multiport --dports 80 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 172.20.0.102/32 -p tcp -m multiport --dports 80 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 172.20.0.103/32 -p tcp -m multiport --dports 80 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 172.20.0.104/32 -p tcp -m multiport --dports 80 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.193.0.244/32 -p tcp -m multiport --dports 60001,60002,60003 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.130.5/32 -p tcp -m multiport --dports 50100:50200 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.129.17/32 -p tcp -m multiport --dports 50203:50213 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.101.97/32 -p tcp -m multiport --dports 25565,25567,25568,30000,30001,50069:50099,4254:4258 -j SNAT --to-source 172.19.0.6
-A dnat_post -d 10.194.101.97/32 -p udp -m multiport --dports 25565,25567,25568,30000,30001,50069:50099,4254:4258 -j SNAT --to-source 172.19.0.6
-A dnat_pre -p tcp -m multiport --dports 80,443 -j DNAT --to-destination 172.19.0.1
-A dnat_pre -p udp -m multiport --dports 80,443 -j DNAT --to-destination 172.19.0.1
-A dnat_pre -p tcp -m multiport --dports 6036,6037,6038,6039 -j DNAT --to-destination 10.194.123.7
-A dnat_pre -p tcp -m multiport --dports 50001,50002 -j DNAT --to-destination 10.194.126.9
-A dnat_pre -p tcp -m multiport --dports 50004,50005 -j DNAT --to-destination 10.193.0.10
-A dnat_pre -p tcp -m multiport --dports 50006,50007 -j DNAT --to-destination 10.193.0.166
-A dnat_pre -p udp -m multiport --dports 50006,50007 -j DNAT --to-destination 10.193.0.166
-A dnat_pre -p tcp -m multiport --dports 50008,50029 -j DNAT --to-destination 10.193.0.156
-A dnat_pre -p tcp -m multiport --dports 50009,50010,50012 -j DNAT --to-destination 10.193.0.41
-A dnat_pre -p tcp -m multiport --dports 50013 -j DNAT --to-destination 10.193.0.41:80
-A dnat_pre -p tcp -m multiport --dports 50014,50015,50050 -j DNAT --to-destination 10.193.0.180
-A dnat_pre -p tcp -m multiport --dports 50016,50017,50025 -j DNAT --to-destination 10.193.0.130
-A dnat_pre -p tcp -m multiport --dports 50027,50028 -j DNAT --to-destination 10.193.0.181
-A dnat_pre -p tcp -m multiport --dports 50029,50030,50031,50032 -j DNAT --to-destination 10.194.126.7
-A dnat_pre -p tcp -m multiport --dports 50033,50034,50035,50036 -j DNAT --to-destination 10.193.0.216
-A dnat_pre -p tcp -m multiport --dports 50037,50038 -j DNAT --to-destination 10.193.1.223
-A dnat_pre -p tcp -m multiport --dports 50039,50040,50041,50042,50043,50044,50045,50046,50047,50048,50049 -j DNAT --to-destination 10.193.1.253
-A dnat_pre -p tcp -m multiport --dports 50050,50051,50054 -j DNAT --to-destination 10.193.2.8
-A dnat_pre -p tcp -m multiport --dports 50052,50053 -j DNAT --to-destination 10.193.2.9
-A dnat_pre -p tcp -m multiport --dports 50055,50056,50057,50058,50059,50060,50061,50062,50063,50064,50065 -j DNAT --to-destination 10.193.1.2
-A dnat_pre -p tcp -m multiport --dports 50066 -j DNAT --to-destination 172.20.0.101:80
-A dnat_pre -p tcp -m multiport --dports 50067 -j DNAT --to-destination 172.20.0.102:80
-A dnat_pre -p tcp -m multiport --dports 50068 -j DNAT --to-destination 172.20.0.103:80
-A dnat_pre -p tcp -m multiport --dports 50201 -j DNAT --to-destination 172.20.0.104:80
-A dnat_pre -p tcp -m multiport --dports 50202 -j DNAT --to-destination 172.20.0.100:80
-A dnat_pre -p tcp -m multiport --dports 60001,60002,60003 -j DNAT --to-destination 10.193.0.244
-A dnat_pre -p tcp -m multiport --dports 50100:50200 -j DNAT --to-destination 10.194.130.5
-A dnat_pre -p tcp -m multiport --dports 50203:50213 -j DNAT --to-destination 10.194.129.17
-A dnat_pre -p tcp -m multiport --dports 25565,25567,25568,30000,30001,50069:50099,4254:4258 -j DNAT --to-destination 10.194.101.97
-A dnat_pre -p udp -m multiport --dports 25565,25567,25568,30000,30001,50069:50099,4254:4258 -j DNAT --to-destination 10.194.101.97
COMMIT
# Completed on Thu Oct 26 20:20:05 2017
# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
25: 1 0 0 0 PCI-MSI 524288-edge enp1s0f0
26: 2 0 1260759450 0 PCI-MSI 524289-edge enp1s0f0-rx-0
27: 2 1596364080 0 0 PCI-MSI 524290-edge enp1s0f0-rx-1
28: 1608171634 0 0 0 PCI-MSI 524291-edge enp1s0f0-rx-2
29: 2 0 0 1431637657 PCI-MSI 524292-edge enp1s0f0-rx-3
30: 2 0 2248452719 0 PCI-MSI 524293-edge enp1s0f0-tx-0
31: 2 2685798284 0 0 PCI-MSI 524294-edge enp1s0f0-tx-1
32: 2407711073 0 0 0 PCI-MSI 524295-edge enp1s0f0-tx-2
33: 2 0 0 2681609538 PCI-MSI 524296-edge enp1s0f0-tx-3
36: 1 0 0 0 PCI-MSI 526336-edge enp1s0f1
37: 2 437882432 0 0 PCI-MSI 526337-edge enp1s0f1-rx-0
38: 401100044 0 0 0 PCI-MSI 526338-edge enp1s0f1-rx-1
39: 2 0 0 403086479 PCI-MSI 526339-edge enp1s0f1-rx-2
40: 2 0 441094187 0 PCI-MSI 526340-edge enp1s0f1-rx-3
41: 2 250815536 0 0 PCI-MSI 526341-edge enp1s0f1-tx-0
42: 265847277 0 0 0 PCI-MSI 526342-edge enp1s0f1-tx-1
43: 2 0 0 274199030 PCI-MSI 526343-edge enp1s0f1-tx-2
44: 2 0 270523776 0 PCI-MSI 526344-edge enp1s0f1-tx-3