A
A
Alyosha2017-12-26 15:55:23
Nginx
Alyosha, 2017-12-26 15:55:23

How to limit incoming traffic?

Pinging a websocket. The speed of a normal user is 0.5-5kb / s, 10mb / s traffic poured from a bunch of different IPs. Through tc, it turned out to limit only the total speed of all traffic. Is it possible to somehow limit the incoming speed for each connection so that each connection (not ip, but connection) can send no more than 5kb / s to the server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Gansterito, 2017-12-26
@Gansterito

You can try through the hashlimit module with hashlimit-mode=srcip,srcport. This parameter will help to fulfill the connection limit condition.
But, it seems to me that it is more correct to keep black and white lists on ipset.

V
Vladimir, 2017-12-27
@MechanID

Consider the Haproxy option as a frontend in front of your service, where you can write very flexible ACLs with traffic limits, number of connections, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question