IPTABLES ile yapılacağını düşünüyorum.

iptables -A INPUT -p tcp --syn -m connlimit --connlimit-above 3 --connlimit-mask 0 -j DROP