Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-05-25 06:37:38

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

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

#2 2018-05-25 06:40:01

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Database file size

Do you have logging turned on? That may cause the variations in database size.

Offline

#3 2018-05-25 06:43:03

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

Re: Database file size

Yes, it’s been on for years. I’ll try turning it off.

james

Offline

#4 2018-05-25 06:47:17

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

Re: Database file size

The amazing, shrinking database is now 1,720 KB with logging turned off.

Offline

#5 2018-05-25 07:52:17

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

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

#6 2018-05-25 07:55:11

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

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

#7 2018-05-25 08:05:04

etc
Developer
Registered: 2010-11-11
Posts: 5,397
Website GitHub

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

#9 2018-05-28 14:30:28

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

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

#10 2018-05-29 10:58:53

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,370
GitHub

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

#11 2018-05-29 11:03:17

jrmartin
Member
From: California | Italy
Registered: 2013-03-07
Posts: 118
Website

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

#12 2018-05-29 11:14:23

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,370
GitHub

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

Board footer

Powered by FluxBB