0

I have a highly loaded server and nginx is consuming all the available bandwidth, and i cannot connect to the mysql server (located on another machine) as i'm getting errors like

Lost connection to MySQL server at 'reading authorization packet'

I wish to set up some sort of Quality of Service so that mysql traffic always has priority and it's packets are never dropped.

Is there any method to do this in centos 7 / rhel?

Alternatively, is there any option to limit / shape the port 80 traffic to let's say 900Mbps?

VelDev
  • 57
  • 1
  • 8

1 Answers1

0

You can use iptables and TC. It would be something like this :

iptables -t mangle -A FORWARD ! -s  192.168.xxx.0/24 -d 192.168.xxx.xxx -j MARK --set-mark 1

tc qdisc add dev <eth> root handle 1: cbq bandwidth 100Mbit avpkt 1000 mpu 64
tc class add dev <eth> parent 1:0 classid 1:1 cbq rate 3200Kbit allot 1514 prio 1 avpkt 1000 bounded
tc filter add dev <eth> parent 1:0 protocol ip handle 1 fw flowid 1:1

The filter is from the IP address of the host, for you you will have to adapt :

  • the iptables lines with the TCP ports of yours applications.
  • and the bandwith of each classes
Sorcha
  • 1,325
  • 8
  • 11