Amazon RDS Instance Using 25~35% CPU While Completely Idle (Zero Sessions, Zero Queries)

0

Hi, I'm evaluating AWS on the Free Tier to determine if it would be appropriate for applications relating to university teaching, and I'm running into pretty significant unexpected charges. I have a single SQL Server RDS database instance with a few tables in it, and about 20 rows of data total. The database was set up using the Free Tier template, is not publicly available (accessed via a Lambda function / API), and hasn't deviated from any default settings other than to try and turn stuff like monitoring off and on again to see if that reduced the CPU load. Basically, sitting bone idle with no queries, no active users, and almost no data in it, the database is using between 25 and 35% CPU constantly. I have rebooted and that had no impact. I've used all the profiling and CloudWatch tools to try and understand it, but given it's not my use of it that seems to be causing the CPU I'm at a loss. I'm getting charged about $2 / day to do nothing and need to get to the bottom of it. The charge isn't a huge problem, but certainly would be if i was to get students to set up a "Free" account and then they then get charged for it. Specific charge is coming under "USD 0.144 per vCPU-Hour of T3 CPU Credits". I just need to understand if the charge is a setting i'm using, or AWS fault, or something else i'm missing. Thanks, Dave

  • What is the type of RDS instance ?

4 Answers
1
Accepted Answer

Hello.

"USD 0.144 per vCPU-Hour of T3 CPU Credits" is probably a charge due to the bursting feature of the T3 instance type.
The RDS free tier instance type (db.t3.micro) has a baseline throughput of 10%, so it will start bursting when the CPU usage exceeds 10%.
In your case, you are using about 25-35% CPU usage, so it is expected that bursting is occurring.
I think this results in costs being incurred.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-credits-baseline-concepts.html#earning-CPU-credits

https://aws.amazon.com/rds/sqlserver/pricing/?nc1=h_ls

T3 CPU Credits
Amazon RDS for SQL Serever T3 DB instances run in Unlimited mode, which means that you will be charged if your average CPU utilization over a rolling 24-hour period exceeds the baseline of the instance. CPU Credits are charged at $0.144 per vCPU-Hour. The CPU Credit pricing is the same for all T3 instance sizes across all Regions and is not covered by Reserved Instances.

Also, looking at the hardware requirements for SQL Server listed in Microsoft's official documentation, the specifications are at a level that can just barely be met with t3.micro.
Therefore, you can expect some CPU usage to occur even if you are not doing anything.
https://learn.microsoft.com/en-us/sql/sql-server/install/hardware-and-software-requirements-for-installing-sql-server-2019?view=sql-server-ver16

profile picture
EXPERT
answered 12 days ago
profile picture
EXPERT
reviewed 12 days ago
profile pictureAWS
EXPERT
reviewed 12 days ago
  • Do you have any suggestions on how to determine where the parasitic CPU drain is coming from?

    I think this is probably due to the load on the process running SQL Server itself. As I shared in the comment above, t3.micro has a performance that barely meets the hardware requirements of SQL Server. Therefore, just running SQL Server may consume a certain amount of CPU usage. https://learn.microsoft.com/en-us/sql/sql-server/install/hardware-and-software-requirements-for-installing-sql-server-2019?view=sql-server-ver16 You may also be able to learn something by enabling Performance Insights or Enhanced Monitoring. https://repost.aws/ja/knowledge-center/rds-sql-server-resolve-high-cpu-use

    How much CPU should a single completely inactive db.t3.micro instance consume just sitting there, before any connections?

    I created RDS SQL Server with t3.micro in my environment. CPU usage was around 15-30% with no connections or SQL running. From this, we can see that SQL Server on t3.micro generates a certain amount of load just by starting. a

  • Would using a different option like MySQL be more likely to have low background CPU usage, or would that be pretty similar across the board?

    I started RDS MySQL and checked. With RDS MySQL, we were able to confirm that the CPU usage rate was low. I confirmed that RDS MySQL was running at 3-7%.

    Is there a different way to get access to non-burstable classes?

    Unfortunately, the RDS free tier only applies to instance types that generate bursts, such as t2.micro and t3.micro. If you can afford the cost, I think it is better to choose a larger instance size. https://aws.amazon.com/rds/free/?nc1=h_ls

  • db.t2.micro isn't an option for me and db.t3.micro is the only available class. I believe db.t2.micro was on the first instance i created, which was probably why it didn't incur charges. Is there a reason that it isn't available now, and can i some how make it available so i can still operate within the Free Tier but with SQL Server?

    Basically, t3 has higher specs than t2, so there should be no problem if you choose t3. I have confirmed that t2.micro cannot be selected from the management console in my environment as well. It is probably possible to start with t2.micro from an API such as AWS CLI, but t3.micro is newer and has higher performance, so I don't think it is necessary to choose t2.micro. https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.InstanceClasses
    Currently, I think the only way is to start using t3.micro, which is the free tier of RDS. I think you have no choice but to accept the charges due to CPU burst credits or use a DB server such as MySQL that is lighter than SQL Server.

0

Thanks for the answer Riku. I am fully aware of the costing model and where the charges are coming from, CPU = cost. Understood. What i don't understand, and the reason for the question, is why is my database using 35% CPU and constant at that (i.e. it's not a peak, it's just steady straight line at 35%) in the first place, when it is authentically idle. Absolutely no activity. No active connections. No queries. I'm the only one able to access it as it's in first stage dev, and it's permanently spun up while doing nothing. Was at that and i did a reboot and it returned to it within 60 secs. Why, is my question. Do you have any suggestions on how to determine where the parasitic CPU drain is coming from? How much CPU should a single completely inactive db.t3.micro instance consume just sitting there, before any connections? Thanks, Dave

daveh
answered 12 days ago
0

Right, so from your results then it would suggest that there is no way to run SQL Server on AWS and remain within the bounds of Free Tier usage, is that right? That's a reasonably disappointing outcome. Would using a different option like MySQL be more likely to have low background CPU usage, or would that be pretty similar across the board? Free Tier isn't overly useful if any version of a db incurs charges just by existing. I also note, i did have a previous SQL Server db live in RDS and it seemed perfectly happy without any additional CPU charges for a week or more before I deleted it in a quest to find a different opaque charge (in that instance, a public IPv4 address relating to making the DB publicly accessible), so it's confusing that there were no bursting issues then, and there are now. When i create a db, the t3.micro is the only option. Is there a different way to get access to non-burstable classes? Thanks, Dave

daveh
answered 12 days ago
0

Thanks, I'll have to rebuild my API to talk to MySQL i guess. The final clarification is around the link you posted and this statement: "750 hours of Amazon RDS Single-AZ db.t2.micro Instance usage running SQL Server (running SQL Server Express Edition) each month." When i created my SQL Server instance (and again looking now), db.t2.micro isn't an option for me and db.t3.micro is the only available class. I believe db.t2.micro was on the first instance i created, which was probably why it didn't incur charges. Is there a reason that it isn't available now, and can i some how make it available so i can still operate within the Free Tier but with SQL Server? Last question, thanks, Dave

daveh
answered 12 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions