# Kernel
kernel.pid_max=4194304
kernel.threads-max=4194304
kernel.sysrq=0
kernel.panic=10
kernel.panic_on_oops=1
kernel.printk=1 1 1 1

# Archivos y procesos
fs.file-max=4194304
fs.nr_open=4194304
fs.aio-max-nr=2097152
fs.inotify.max_user_instances=2097152
fs.inotify.max_user_watches=2097152

# Memoria
vm.swappiness=0
vm.dirty_ratio=40
vm.dirty_background_ratio=5
vm.overcommit_memory=1
vm.overcommit_ratio=100
vm.max_map_count=2147483647
vm.vfs_cache_pressure=1
vm.dirty_writeback_centisecs=50
vm.dirty_expire_centisecs=100
vm.min_free_kbytes=1048576
vm.zone_reclaim_mode=0

# Red – TCP/UDP ultra agresivo y estable
net.core.somaxconn=1048576
net.core.netdev_max_backlog=262144
net.core.optmem_max=33554432
net.core.rmem_default=134217728
net.core.rmem_max=2147483647
net.core.wmem_default=134217728
net.core.wmem_max=2147483647

net.ipv4.tcp_rmem=4096 87380 2147483647
net.ipv4.tcp_wmem=4096 65536 2147483647
net.ipv4.udp_mem=65536 131072 2147483647
net.ipv4.udp_rmem_min=8192
net.ipv4.udp_wmem_min=8192

net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_max_syn_backlog=1048576
net.ipv4.tcp_max_tw_buckets=1048576
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_fin_timeout=15
net.ipv4.tcp_keepalive_time=600
net.ipv4.tcp_keepalive_intvl=60
net.ipv4.tcp_keepalive_probes=5
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_abort_on_overflow=0
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_fastopen=3
net.ipv4.ip_local_port_range=1024 65535
net.ipv4.ip_forward=1
net.ipv4.ip_nonlocal_bind=1
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_slow_start_after_idle=0

# Desactivar IPv6
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

