то есть тебе надо не определить "айпишник попадает в диапазон XX..YY", а "в какой диапазон попадает айпи"?
Пользователь задаёт несколько диапазонов, айпи, протоколы и диапазоны портов. Если айпи попадает в один из нескольких диапазонов алерт, если в протоколы алерт и если в порты, тоже Алерт.
There is no magic rule for setting the number of processes or threads to use. It is very much application and system dependent. Simple math like processes = 2 * cpucores will not be enough. You need to experiment with various setups and be prepared to constantly monitor your apps. uwsgitop could be a great tool to find the best values.