Problem with widget
-
I was wondering why my site was painfully slow, taking many seconds to load and sometimes just timing out. I found that I had to remove my gallery widget from the sidebar which was displaying 6 thumbnails and the site returned to normal speed. Adding the widget back to the sidebar caused the site to bog down again so clearly it was the problem.
Is this a known problem?
-
@ajkphotography – It is possible the NextGEN Gallery widget may take some time to load but that may also be related to the specific settings you are using … for example if you are choosing 6 random images from 1000’s of images then it will take some time to “choose” those 6 images as it has to index all of those images before it can make the selections.
– Cais.
This depends on MySQL slow_queries.
Here are some that I have logged (WP 3.8.1 and NGG 2.x branch) in our server:
#######################################################
# Time: 140125 8:13:25
# User@Host: fucinemute[fucinemute] @ localhost []
# Query_time: 10.767526 Lock_time: 0.000053 Rows_sent: 1273 Rows_examined: 7407587
SET timestamp=1390634005;
SELECT pid ,wp_options.option_valueAS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROMwp_ngg_picturesLEFT OUTER JOINwp_optionsONwp_options.option_name = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.pid) LEFT OUTER JOINwp_postmetaONwp_postmeta.post_id=wp_options.option_valueWHERE (exclude= 0) GROUP BY wp_ngg_pictures.pid ORDER BY rand();#######################################################
# Time: 140125 8:13:36
# User@Host: fucinemute[fucinemute] @ localhost []
# Query_time: 10.748086 Lock_time: 0.000079 Rows_sent: 30 Rows_examined: 7406344
SET timestamp=1390634016;
SELECT wp_ngg_pictures.* ,wp_options.option_valueAS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROMwp_ngg_picturesLEFT OUTER JOINwp_optionsONwp_options.option_name = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.pid) LEFT OUTER JOINwp_postmetaONwp_postmeta.post_id=wp_options.option_valueWHERE (exclude= 0) GROUP BY wp_ngg_pictures.pid ORDER BY rand() LIMIT 30;#######################################################
# Time: 140125 8:13:54
# User@Host: fucinemute[fucinemute] @ localhost []
# Query_time: 11.220924 Lock_time: 0.000054 Rows_sent: 1273 Rows_examined: 7410133
SET timestamp=1390634034;
SELECT pid ,wp_options.option_valueAS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROMwp_ngg_picturesLEFT OUTER JOINwp_optionsONwp_options.option_name = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.pid) LEFT OUTER JOINwp_postmetaONwp_postmeta.post_id=wp_options.option_valueWHERE (exclude= 0) GROUP BY wp_ngg_pictures.pid ORDER BY rand();#######################################################
# Time: 140125 8:14:06
# User@Host: fucinemute[fucinemute] @ localhost []
# Query_time: 10.822486 Lock_time: 0.000076 Rows_sent: 30 Rows_examined: 7408890
SET timestamp=1390634046;
SELECT wp_ngg_pictures.* ,wp_options.option_valueAS ‘custom_post_id’, GROUP_CONCAT(CONCAT_WS(‘@@’, meta_key, meta_value)) AS ‘extras’ FROMwp_ngg_picturesLEFT OUTER JOINwp_optionsONwp_options.option_name = CONCAT(‘wp_ngg_pictures_’, wp_ngg_pictures.pid) LEFT OUTER JOINwp_postmetaONwp_postmeta.post_id=wp_options.option_valueWHERE (exclude= 0) GROUP BY wp_ngg_pictures.pid ORDER BY rand() LIMIT 30;#######################################################
As you can see Query_time was alway 10 seconds and even more.
Such logging happened with NGG widget being enabled.Rollback to NGG 1.9.x and even with WP 3.8.1 everything works perfectly as always: http://www.fucinemute.it/
My 2 cents.
Thanks for your replies photocrati and fucine.
The site has 980 mostly optimised images, 48 galleries and 9 albums and was running fine not so long ago with the widget and same number of images. I don’t know the exact point where it slowed down, whether it was after an NGG update or after a recent wordpress update. All I know is that with the widget the site is virtually crippled and without it it’s fine.
Believe me, ajkphotography… When NGG widget was active, and considering that our webmagazine has 20.000 pageviews per day, MySQL’s CPU usage was almost 200% (widget is inoculated into any page, and home as well).
The fact is quite clear: NGG above 1.9.13 version AND WordPress above 3.7.1 version are not compatible. Not at all.
If you want to run WP 3.8.x then you have to revert NGG back to 1.9.13. As simple as this: http://www.nextgen-gallery.com/how-to-rollback-a-version/
Anyway the plugin developers should take a look at those queries. Some profiling is highly required…@ajkphotography – If you are seeing similar issues as @fucine is trying to in your topic then you can expect improvements with our next (beta) release which addresses many of the query calls that are being pointed to.
– Cais.
@photocrati: thanks for the effort you’ll put in optimizing both queries and the overall PHP code.
The topic ‘Problem with widget’ is closed to new replies.