I added a few thousand IPs packed in multiple /24 classes to a CentOS box and because of that I am getting scanned day and night. Since this server will be a workhorse and it will only need to be available on SSH (changed SSH port) and http/s, I ended up blocking mail ports and ping replies. That resolved the high response time over http/s, but iptables increased the load on the server.
I am getting:
top - 22:01:30 up 2 days, 10:17, 3 users, load average: 1.99, 2.23, 2.07
Tasks: 198 total, 2 running, 195 sleeping, 0 stopped, 1 zombie
Cpu(s): 1.0%us, 5.1%sy, 0.0%ni, 85.0%id, 0.0%wa, 0.0%hi, 8.8%si, 0.0%st
Mem: 16638532k total, 2692948k used, 13945584k free, 206992k buffers
Swap: 8193140k total, 0k used, 8193140k free, 2093204k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
7091 root 23 0 25704 23m 512 R 72.5 0.1 0:02.26 iptables
28507 root 15 0 10236 3308 2684 S 4.5 0.0 0:51.00 sshd
How can I resolve this issue, since the server is very slow when doing even basic stuff, like accepting a command via SSH ? I will be looking at a hardware firewall in the upcoming months, but until then the issue has to be resolved with a software solution.