Slow website, MySQL db is over 1.1GB – how can I reduce the size?

Posted in: Newspaper
Post count: 7

I have a news website and it’s too slow. There are over 7000 articles.
How can I reduce the size of database? I tried using wp sweep but it’s not working.

I checked which table is the biggest and find out that wp-option table is over 800mb.
https://imgur.com/r4uSN4I

I tried to identify wp-option table is a handful of huge records, or if there’s just a ton of junk in there.
This is what I’ve found. It has 3813795 total rows.

These have the largest length.
https://imgur.com/PYoGZX3

Which of these I can delete, because I see some of there are from Newspaper theme (td_011, td_011_remote_cache,td_011_log)?

Here is also my htaccess code:

# BEGIN WordPress

# BEGIN Math Captcha
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .wp-comments-post.php*
RewriteCond %{HTTP_REFERER} !.*www.otisak.ba.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]
</IfModule>
# END Math Captcha

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# BEGIN Compress text files
<ifModule mod_deflate.c>
  <filesMatch "\.(css|js|x?html?|php)$">
    SetOutputFilter DEFLATE
  </filesMatch>
</ifModule>
# END Compress text files

# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 604800 seconds"
ExpiresByType image/jpeg "access plus 604800 seconds"
ExpiresByType image/png "access plus 604800 seconds"
ExpiresByType image/gif "access plus 604800 seconds"
ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
#ExpiresByType text/html "access plus 600 seconds"
#ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers

php_value max_input_vars 5000

Site is run on
CentOS 7.1 x64
10GB RAM
6 CPU

  • This topic was modified 7 years by deltabh. Reason: Photos not visible
  • This topic was modified 7 years by deltabh.
Post count: 7

Post count: 7

I forgot to say that the site in on PHP 5.4.16 version

https://i.imgur.com/VkthW80.jpg

  • This reply was modified 7 years by deltabh. Reason: Photo not appearing
Post count: 20688

Hi,

The wp-options table is where all the theme and all the plugin data are kept. From what I know for example after uninstalling plugins, changing themes, the data they saved there will not be removed in most cases. So it may end up being very big indeed.

You could check some optimization guides for the wp-options
https://kinsta.com/knowledgebase/wp-options-autoloaded-data/
https://www.webhostinghero.com/blog/how-to-cleanup-the-wp-options-table-in-wordpress/
https://premium.wpmudev.org/blog/optimizing-your-wordpress-database-a-complete-guide/

Be sure to make a backup before making any modifications to the database, just to be safe.

Thanks

Post count: 7

I have already checked those tutorials and deleted transient from plugins I don’t use anymore.

As you can see on the photo the biggest rows are the ones related to Newspaper theme. Correct me if I am wrong.
– td_011
– td_011_remote_cache
– td_011_log
– Newspaper_demo_history

What should I do with them? Can I delete it? If not how to reduce the size of it?

Post count: 20688

The td_011 does indeed belong to the theme, it is where all the theme panel settings, custom code from theme panel and other theme settings are kept. If these would be removed the mentioned data will be lost.

However having a size like you mention is quite large. In my local install I exported the td_011 table, it is nowhere near such a huge size – http://prntscr.com/m7stcw
The remote cache, log, and demo history could be cleared, make a backup before.

Post count: 7

Great. Thank you for your help. It solved my problem.
Tagdiv has the best support and that’s why you will always be far ahead of others.

Post count: 3

I have a scenario very similar to the one you reported. Could you explain to me what you did to resolve it?

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.