I'm running a heavy python script in a EC2 instance. This script is inserting tables (financial reports) to a MySQL server. There are lots of tables, the total amount is 240.000 tables. I started the python script 1 day ago and these are the stats of MySQL server. CPU Utilization / Memory As you can see, cpu utilization seems normal but memory has gone down since the script started running. Note that I'm only running this script, there is no other work for MySQL. How can I maintain the memory stable?
Asked
Active
Viewed 80 times
1 Answers
4
Nope. The idea that a properly written database is a CPU hog is a delusion - high CPU utilizatzation in databases quite often is the result of awful queriey, i.e. joining mismatching data types (int vs string, resulting in a TON of conversions).
Normally a databases uses - in this order:
- Memory
- IO
- CPU
Memory is first because it will try to cache as much as it can and the admin allows it. IO because that is next once the cache runs out. CPU is LAST - and by far last.

TomTom
- 51,649
- 7
- 54
- 136