Stash
ExpressionEngine 2, ExpressionEngine 3, ExpressionEngine 4, ExpressionEngine 5, ExpressionEngine 6
Back to this add-on's main page
View Other Add-ons From Mark Croxton
exp_stash table huge & causing performance issues
Support Request
JUK
|
Posted: 09 September 2015 08:18 PM |
|
|
|
I’ve been in contact with my host for a week due to severe performance issues.
One of the things they came back with is the size of the Stash table (exp_stash) which is huge:
root@serv01 [/var/lib/mysql/myaccount_db]# du -sh exp_stash.* 12K exp_stash.frm 897M exp_stash.ibd
I haven’t looked into optimising Stash, and it appears wrong that the Stash table is so big.
I’d appreciate some feedback as to what might have caused this and how I can optimise Stash for speed.
Thank you!
|
|
|
JUK
|
Posted: 10 September 2015 04:21 AM |
# 1
|
|
|
From what I’ve researched I suppose I can safely delete the table “exp_stash”?
Do you know why it has ballooned to such a huge size?
|
|
|
|
Mark Croxton
|
Posted: 10 September 2015 05:30 AM |
# 3
|
|
Developer
|
As an aside, large Innodb tables are not really a performance issue if you have configured MySQL with enough memory to hold the table indexes in memory, and the queries against the table are optimised to make use of the indexes (which Stash absolutely does).
Tuning MySQL is well worth doing and will yield significant performance gains. At the very least you should increase the ‘innodb_buffer_pool_size’ value and the ‘key-buffer-size’ to set how much memory MySQL will use for data and indexes in memory. If you are running apache and mysql on the same server then you would typically want Mysql to use up to 20% of system ram. As you are running Stash which uses Innodb, the ‘innodb_buffer_pool_size’ should be around twice ‘key-buffer-size’ value (also applies with any other adds-on that use Innodb, such as Store). Here’s an example of a config I use (but of course it will depend on your server):
https://gist.github.com/croxton/d2294e9413ed3c4ebde1
SSD has very significant benefits for all database I/O, so that’s something you should consider too.
|
|
|
JUK
|
Posted: 10 September 2015 06:20 AM |
# 4
|
|
|
Thank you, Mark, that are good recommendations.
I was still running Stash 2.3, so the first thing I did was upgrade to the current version.
I’ve then replicated an empty table exp_stash and deleted the bloated copy of it.
I now need to follow up with the 404 treatment, and monitor exp_stash to see if my measures are successful.
I guess I cannot optimise MySQL as my host doesn’t allow that granularity of control? Or can I do that with an INI file?
Thank you for your support!
|
|
|
JUK
|
Posted: 12 September 2015 01:35 AM |
# 5
|
|
|
In fact I was having trouble with EE’s 404 tag (how did you know??). Using
{redirect="404"}
in the code below resulted in an endless wait for the page to render, and only deleting the CE Cache entry finally showed the 404 page.
This is the code I am using now to verify if the category is correct:
{!-- Trigger 404 if categories don't match --} {if "{exp:stash:get name='entry_category_name'}" != "{exp:stash:get name='current_category_name'}"} {exp:stash:not_found} {/if}
EDIT: This doesn’t work either, it now gives me a 404 for *all* pages…
|
|
|
|