XenForo is chatty, or, how to compress mysql

Rigel Kentaurus

Well-known member
Maybe it is because forum software is meant to enhance.. communication
Maybe it is because the mysql protocol is like that
Maybe it is all of those SELECT * clauses

Be what it be, I was having some problems because one of my hosts had a 10Mbps card. Or rather, the switch was 10Mbps (the card was gigabit). And here I am on the 2013 running on a bandwidth constraint.

And, the application server and the database are NOT the same box. At some point when growing up you give each child their own space. Which means they talk over the network. I was surprised. It takes almost a whooping 40Mbps out of the network card (and this is with 250 online users)

Screen Shot 2013-05-06 at 2.10.57 AM.png

This is the kind of problems that one runs into when doing things like splitting the database to its own box. The network just has to be right. But 250 online users is not a lot. I cannot imagine how demanding it would be with an installation that has a thousand simultaneous users.

For the observant, you are noticing the drop after Week 15? I did something. I enabled compression over mysql, which is very well supported for Mysqli, but surprisingly not supported by the Zend version that XenForo distributes. I had to go and manually patch the file. (I really hope I remember to do it after the upgrade, else, the slowness will remind me)

The class is Zend_Db_Adapter_Mysqli and the patch is simple

Screen Shot 2013-05-06 at 2.12.06 AM.png

Compression will demand a bit of CPU, but network was so bad that I did not care, the few CPU that gzip uses overcomes the millisecond latency of transfering 40 Megabits per second. And it DOES compress as much as 20 times, so I definitely recommend enabling compression if you are hosting your db and application server on different boxes.