[Music]
hello I'm really a cloud Support
Engineer here at the AWS office in
Dallas sometimes customers tell me their
Amazon RDS database instance on my
sequel is using more space than expected
they ask me why this happened and how
can they optimize this storage I tell
them you can use the free storage space
Amazon CloudWatch metric to one set the
available storage space for an RDS DB
instant let me walk you through the
process after logging into your AWS
management console navigate to the RDS
console on the left hand panel select
databases choose the required my sequel
database under monitoring you can search
for the free storage space metric graph
of your DB instance but that metric does
not describe how the DB instance is
consuming storage there are few
strategies you can use to reclaim
storage space to show you I will move
over to the terminal connect to your RDS
my sequel DB instance some space
consumed by table isn't actively in use
but is allocated to the table anyway if
in a DB file per table is enabled you
can reclaim that space using optimized
table to see if in ODB file table is
enabled or not you can run the below
command now we can see from the terminal
it's enabled this is enabled by default
to check for fragmentation you could use
a query similar to the following you can
find the query with the knowledge center
article with this video you can modify
the above query with your own schema the
data free column highlights the amount
of free space allocated to the table
that isn't actively in use to claim back
that space you can run the command now
the above query will free the space
already utilize to see how much storage
is being used by application tables on
your DB instance
can run it very similar to the following
to look at the largest application table
on your DB instance you can run it very
similar to the following the output
shows the largest application tables on
your DB instance please note the
provided optimized table option works
only if in ODB file per table is set to
one if it is set to zero all the tables
are also allocated to the system
tablespace and you can only reclaim the
space by exporting your current database
data and then import the data into new
instance adding a read replica causes
the master instances binary log to use
additional storage to find out how much
storage the binary log on the master
instance is using check the bin log disk
usage CloudWatch metric now I am in the
RDS console at the left-hand panel
select databases choose the required my
sequel DB instance under one string you
can search for binary log disk metric
graph of your DB instance Amazon RDS
normally purchase a binary log as soon
as possible
you can reduce the binary log retention
period to use less storage space the
following example sets the retention
period to one day now I'm back in the
terminal you can check the my sequel bin
log retention period by running the
below command it will show you the
output bin log retention is set to 24 if
you have logs enable like general and
slow query locks on your DB instance
they normally consume disk space you can
rotate them to the backup table to clear
the space you can run the below query to
achieve it thanks for watching and happy
cloud computing from all of us here at 8
[Music]
you
[Music]