-2

I have a bit of an issue with my SQL queries. Basically whenever someone within my network uploads something (to gmail, dropbox anything) my SQL-queries become approximately 20 times slower.

Sadly, where I am, we can only get a 6mbit internet connection, so that may be part of the problem and our upload-speeds are particularly terrible (usually uploads will fluctuate heavily between a few hundred bytes (!) and about 100 kb per second. But I am still confused as to why this causes my sql-queries to execute soooo slowly. Is this reasonable?

I am accessing a MySQL-server through a vpn but I doubt that that is the problem since it works fine if no one is uploading anything ..

Is there maybe a way to reserve some bandwidth for SQL-queries?

** EDIT ** I am the only one using the VPN. My internet-trafic does not go through the VPN.

Jonidas
  • 7
  • 4

2 Answers2

3

Sounds like Qos (Quality of service) needs to be implemented.

Depending on where your OpenVPN set up is configured (local, device behind the router, or on the router itself) and if the other people saturating the connection are also using the VPN connection, either your router or VPN device will need to have QoS applied to it.

Gene
  • 3,663
  • 20
  • 39
  • Oh, I should have clarified: I am the only one using the VPN, the client is on my machine, the VPN-Server on the machine that the MySQL-Database is on. I am not using the servers internet-connection, the VPN serves only as a tool for better security and to have the MySQL-Connection always from the same range of IPs ... – Jonidas Sep 02 '15 at 16:42
  • But the server is outside of your network, somewhere on the internet? If so then you need to implement QoS on your router to guarantee bandwidth for or provide priority to your VPN connection. – Gene Sep 02 '15 at 16:57
0

Sounds like bufferbloat. If this is what you are experiencing, it means there is a design flaw in the modem you are using (which may be built into your router). The modem is capable of receiving traffic from your LAN faster than it can send it on the WAN. In this case the modem need to buffer some packets, but eventually it will have to discard packets.

A too small buffer will cause a drop in usable upstream bandwidth. A too large buffer will cause in increase in roundtrip latency.

If you are unable to replace the modem, you can still work around the problem by having a device throttle traffic before it reaches the modem. I would throttle traffic to about 90% of the upstream capacity. Be careful in choosing this device as this device also can introduce bufferbloat. (I experienced that myself when I noticed a small bufferbloat problem on my 5Mbit/s uplink and I tried avoiding that by throttling it to 4Mbit/s on the D-Link switch I have between router and modem - only to realize the D-Link was using a larger buffer than the modem).

If you do find a device which can throttle the traffic and thereby avoid the bufferbloat, the same device can also implement QoS as suggested in another answer. Notice that implementing QoS without fixing the bufferbloat problem is unlikely to help a lot.

kasperd
  • 30,455
  • 17
  • 76
  • 124