I am trying to understand pricing for Redshift Serverless but slightly confused between compute_seconds
and charged_seconds
.
I have currently set base RPU to 128 which is the default.
I have have executed certain queries and after that have queried the sys_serverless_usage
view and I see the below results
below are some of my questions
- Does compute_seconds refer to the number of seconds it took for the query to execute?
- what’s the difference between
charged_seconds
andcompute_seconds
. On row 6 i see thatcompute_seconds
is0
butcharged_seconds
are7680
.
Any help here would be great, thanks.
2
Answers
Yes, compute would be the number of seconds to execute the query
Charged seconds could be rounded up based on the minimum billing of 60 seconds. 128 RPU * 60 seconds = 7680
So you are charged at minimum for 60 seconds of compute, that means for each time interval of 1 minute (like in the table) you will be charged
60sec * compute_capacity
So because your base RPU is set to
128
~ when you run queries it will take the seconds that Serverless is running and multiply it by128
For example the 3rd row your compute seconds is
3799
and128
rpuso essentially for each row you can take the
compute_capacity
and use that do derrive seconds that cluster was runningcompute_seconds / compute_capacity
and the charged_seconds is essentially showing you what you are going to be billed each minute (due to 1 minute min billing)
so at
128
RPU each minute at0.375 Per RPU Hour
thatsso WHENVER you run some queries at
128
Base RPU you are going to be charged79c
for each minute the cluster is in use, even if you run 1 query that finishes in 200ms you will be charged for the full minute, alternatively if you run 50 queries concurrently at128
RPU and they all complete in 30secs within the same minute, you will be still only charged79c