On the distribution database, you can execute the statement below to get the sizes of the internal replication specific tables
You can use the code below on your distributor in order to check the backlog of the replication
You can use the t-sql code to resume/suspend all databases from the always on group.
In order to optimize all databases & tables within your mysql instance, you can use the code below. You can also use a more specific script, where only the tables are optimized which have 10MB free space and 10% free space.