I would like to know how to get database data transfer stats in PostgreSQL and MySQL.
Like for example I need to know how many bytes are transfered per day/week/month.
Thanks in advance! Regards.
I would like to know how to get database data transfer stats in PostgreSQL and MySQL. Like for example I need to know how many bytes are transfered per day/week/month. Thanks in advance! Regards. |
|||||
|
MySQL:
This reports the total number of bytes sent and received since the last server restart. Unfortunately, MySQL doesn't track per day/week/month subtotals. But you can estimate an average bytes per second by dividing these totals by another global status variable 'Uptime' which is the number of seconds since the last restart. Another option is to use a monitoring tool that collects the status values at an interval and graphs them. For example Cacti is a popular open-source monitoring tool, and you can install MySQL-specific graphs. The best (free) ones are the Percona Monitoring Plugins for Cacti (disclaimer: I work for Percona). PostgreSQL: No tracking of bytes transferred is supported. I found a discussion thread about a proposed patch to add this capability, during October 2013, but I guess it hasn't become part of any released version of the product yet: http://postgresql.1045698.n5.nabble.com/stats-for-network-traffic-WIP-td5775200.html General: You can also use netstat or other tools outside of the MySQL/PostgreSQL to measure network activity. |
|||||
|