fucine
Forum Replies Created
-
@photocrati: thanks for the effort you’ll put in optimizing both queries and the overall PHP code.
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…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.