views:

20

answers:

1

Is there any significant overhead to turning on mysql's connection compression for high load databases or is it always a winner?

We have databases delivering very small datasets back to the requesting program (PHP) but these databases receive very large bursts of traffic from time to time. If I turn on connection compression am I likely to see a significant degredation in performance under load?

We're using modern hardware but not it's a fairly average server setup i.e. one or two dual core CPU's, 8 GB of ram, etc.

A: 

There is no way to tell in your situation if it will help or not help. There is simply not enough information.
Does "large bursts of traffic from time to time" mean lots of small packets or a few very large packets or does it relate more to the number of sql queries?

Are the Database Servers on a remote machine(s)?
What's the bandwidth between application and database server, Lan Mbits,Gbits,Tbits. or WAN Kbits,Mbits.?
What does "High Load" mean. are you running out of CPU resources, Memory, Disk IO or bandwidth?

Some notes...

  • Compression is cpu intensive
  • Compression of large datasets is bandwidth friendly
  • Compression on small datasets (what is small?) will probably only add a negligible increase in CPU usage, but will also only improve bandwidth negligibly
  • If your application and mysql server are on the same machine I doubt you will get any advantage from compression, because the bandwdth is high and compression and decompression require CPU resources.

Without a more concise description of what the conditions are its hard to give a concise answer.

DC

DeveloperChris
This was meant to be more of a general question hopefully resulting in answers which would indicate the most appropriate times to have compression turned on/off generally, and point out any quirks which wouldn't coincide with the general expected effect of a compressed connection. But as you ask, in my specific situation:Yes the databases are remote Servers are on very high bandwidth connectionsHigh load is hundreds poss. thousands of queries per second on a well optimised small database (biggest table ca. 150k records) Majority of queries are for settings like information
coderchris
In that case the answer is in the notes I gave you. From that I would say compression is probably not needed. The only way to tell is to do some performance testing under all conditions. There are never hard and fast rules and there is no real "general" answer.
DeveloperChris