Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Database file size
In preparation for upgrading Wandering Italy, which has 1137 posts, I backed up the database via C-panel. The file size was 2,434 KB. Problem is, the last backup on 4/22/2018 was 11,741 KB and the one before that was 10,800. The site seems to be working fine, but is there an explanation of how the database could shrink like that? I haven’t messed with it.
On the same server I have another textpattern site that contains fewer than 200 posts that has a database site that has gone up with each backup and is currently at 9,742 KB.
There are no error warnings and as I“ve said, everything is working fine. Should I just go ahead with an upgrade from 4.62 to 4.7?
james
Offline
Re: Database file size
Do you have logging turned on? That may cause the variations in database size.
Offline
Re: Database file size
Yes, it’s been on for years. I’ll try turning it off.
james
Offline
Re: Database file size
The amazing, shrinking database is now 1,720 KB with logging turned off.
Offline
Re: Database file size
I think if logging is turned on, the log pruning occurs each time you log into the system (i.e. it doesn’t happen at regular timed intervals automatically). So if you haven’t logged in for a while the log grows in the background.
Not sure why it was done like that, was legacy code from quite a few years ago. I personally don’t use the logging system at all anyway so I leave its turned off permanently. There’s been talk of removing the logging feature entirely in Textpattern 4.8 but no firm decision either way as yet.
Offline
Re: Database file size
It’s a pretty active site, so I’ve logged in probably every other day. It’s just that the numbers in one month have changed so drastically.
Offline
Re: Database file size
jrmartin wrote #312080:
It’s a pretty active site, so I’ve logged in probably every other day. It’s just that the numbers in one month have changed so drastically.
The help says The logs only get trimmed when you view the ‘Visitor logs’ panel, and will otherwise continue to grow in size
(actually also when you save preferences). Sometimes they come in waves — robots, spammers…
Offline
#8 2018-05-25 12:05:04
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,315
Re: Database file size
Is the later export compressed? Anyway, if you don’t trust your export you have the possibility to do another one with e.g. Adminer, a one file standalone DB administration.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Database file size
etc wrote #312081:
The help says
The logs only get trimmed when you view the ‘Visitor logs’ panel, and will otherwise continue to grow in size
(actually also when you save preferences). Sometimes they come in waves — robots, spammers…
Ah, I’ve found the secret. Visiting the “Visitor logs” panel doesn’t do it, but turning logging off and then back on a few seconds later clears it. My wife’s site Martha’s Italy dropped database size from 54 MB to 4 MB when I did that.
Offline
Re: Database file size
I am reminded of Jacques having to deal with huge (>130 million lines) instances of txp_log
tables: forum.textpattern.com/viewtopic.php?id=40211
Last edited by gaekwad (2018-05-29 10:59:07)
Offline
Re: Database file size
gaekwad wrote #312166:
I am reminded of Jacques having to deal with huge (>130 million lines) instances of
txp_log
tables: forum.textpattern.com/viewtopic.php?id=40211
Yes, Martha’s Italy used to have a couple of seconds delay before anything appeared, and now starts loading immediately. It had maybe 2 years worth of logs. Maybe it’s less of a problem in 4.70. I hope.
james
Offline
Re: Database file size
jrmartin wrote #312167:
It had maybe 2 years worth of logs. Maybe it’s less of a problem in 4.70. I hope.
I suspect not. The mechanism that clears the logs is still a) visit the logs page to truncate to however many days you retain, b) truncate the logs in the database on a given schedule or c) turn logging off then on again (as you found).
Bluntly, there are far better ways of getting insights into this kind of thing outside of Textpattern. Dedicated things like self-hosted or cloud web analytics will get you much more salient info: en.wikipedia.org/wiki/List_of_web_analytics_software
And, if you’re feeling introspective, ask yourself if you really need this kind of info at all: en.wikipedia.org/wiki/You_aren%27t_gonna_need_it
If not, turn it off.
Last edited by gaekwad (2018-05-29 11:15:04)
Offline
Pages: 1