1

I have a problem with the database. It weighs a whopping 450 megabytes. That's a lot. It increases by about 20 megabytes per night. I suspect that this has something to do with the CRON task: an http request is executed every hour that triggers an update of prices in the game catalog.

Question 1. I looked, there is a saving of versions of each record every hour. How to prohibit this saving?

Question 2. The database weighs 450 megabytes. Do they really weigh that much? If this is the case and disabling version control will help, then how and where to clean all these versions so that the database does not weigh so much?

6
  • Have you checked which database tables contain all that data? What records are being saved every hour?
    – MoritzLost
    Commented Dec 13, 2022 at 13:36
  • @MoritzLost The "queue" table increases in size. Added a lot of entries with the description "t9n:["app","Updating search indexes"]"
    – Dimi
    Commented Dec 13, 2022 at 13:44
  • 1
    You might want to check if these tasks are also run. If you do not trigger the queue/run command, the queued tasks will only be run when somebody logs into the backend. But you can write another cronjob to run the queue. You can read more about that here: nystudio107.com/blog/robust-queue-job-handling-in-craft-cms Commented Dec 13, 2022 at 14:12
  • 1
    You should add some context about the size of your site - i.e., how many sites, sections and entries does it have? 450MB for a single site with only a small number of entries would be considered huge, but for a multi-site installation with 10k entries it would be considered very small. Commented Dec 13, 2022 at 16:37
  • 1
    Your queue table should generally be empty. Jobs are only stored while they're queued, and only remain there if they failed. Are you sure you're executing your queue as per Max's comment? Commented Dec 13, 2022 at 17:39

1 Answer 1

1

It's not that big in all honesty.

You can see the biggest tables by running

SELECT table_name AS "Tables", round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" FROM information_schema.TABLES WHERE table_schema = "your_db_name" ORDER BY (data_length + index_length) DESC;

Also worth checking max revisions.

You can set the max revisions in config https://craftcms.com/docs/4.x/config/general.html#maxrevisions

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.