Bug #10675
closedNextGEN Gallery and other tools using "Freemius" cause excessive db i/o
0%
Description
Spotted while examining recent performance issues: Plugins that use the Freemius library https://github.com/Freemius/wordpress-sdk - especially NextGEN Gallery, but it also exists in some other Commons plugins - can cause excessive write queries. A backtrace is attached (the first few items are related to my debugging tools, which hook to pre_update_option_fs_accounts).
My best guess as to what's happening is that the plugin is attempting to update_option( 'fs_accounts' ) with a value that is very huge (because it contains a list of all plugins on the system). It's likely that the update routine is experiencing latency due to its huge size. It's also possible that the entries are too big for Memcached, so that they're not being properly reported as having been set. In any case, it's triggering an update on nearly every pageload on affected sites. I have a hunch that this is one of the underlying causes of ongoing performance issues.
We are not the only ones experiencing the problem. See https://github.com/Freemius/wordpress-sdk/issues/260
For the time being, I'm going to hotfix the plugin so that it does not attempt the update_option(). Then I'll spend some more time looking into more general solutions.
Files
Updated by Boone Gorges almost 6 years ago
The Freemius tool seems kind of icky generally. In https://github.com/cuny-academic-commons/cac/commit/3a8add2802f596b125e06c957b5402ab66b9788a, I've blocked it from loading at all on nextgen-gallery.
Updated by Matt Gold almost 6 years ago
Interesting. Thanks, Boone, for this continuing work
Updated by Boone Gorges almost 6 years ago
https://github.com/cuny-academic-commons/cac/commit/c9d582f4009ae8840dd48918b9f038725d3bf048 is a more permanent workaround. It forces the value stored in fs_accounts to be an empty array.
I'll leave this ticket open to assess what happens after 1.13.13.