sushantchawla2005
Forum Replies Created
-
Hi @sazdhossain
Can you revert back on this urgent issue, please?
Hi @dbisupport
Thanks for your response. We are not using Redis on the application as it was causing some conflicts with plugins, so let’s assume we don’t have Redis available.
I believe the plugin uses amazonS3_cache as I have seen queries having this string regularly but the issue is those queries which doesn’t hit the cache. Our wp_as3cf_items table has 2127032 rows so whenever queries like the following one triggers, it causes a lot of resource usage and slowness.
MariaDB [XXXXXXXX]> SELECT * FROM wp_as3cf_items WHERE (path LIKE '%uploads/2025/07/BVPK000273-2201478-1-300x300.webp' OR original_path LIKE '%uploads/2025/07/BVPK000273-2201478-1-300x300.webp');
Empty set (33.923 sec)MariaDB [XXXXXXXX]> select count(*) from wp_as3cf_items;
+----------+
| count(*) |
+----------+
| 2127032 |
+----------+
1 row in set (0.508 sec)Due to the wild cards in these queries, it forces database engine to scan through 2 Million+ rows and use lots of resources.
If we use this query, it uses indexes and triggers really quick.
SELECT * FROM wp_as3cf_items WHERE (path LIKE 'uploads/2025/07/BVPK000273-2201478-1-300x300.webp' OR original_path LIKE 'uploads/2025/07/BVPK000273-2201478-1-300x300.webp');
Empty set (0.000 sec)Additionally, I have tried to search for the strings as3cf or S3 in debug.log but there are no such entries there.
I hope this would help you apply the required optimisations to the plugin’s code. Looking forward to your response.
Regards,
Sushant ChawlaHey @vinkmeta Thanks for fixing it, now there is another slow query frequently popping up in slow logs from the same plugin:
Time: 250828 10:35:49 User@Host: XXXXXXXX[XXXXXXXX] @ localhost [] Thread_id: 7617 Schema: XXXXXXXX QC_hit: No Query_time: 5.058751 Lock_time: 0.000038 Rows_sent: 1 Rows_examined: 251409 Rows_affected: 0 Bytes_sent: 263SET timestamp=1756377349;
SELECT option_value
FROM wp_options
WHERE option_name LIKE 'wc_facebook_background_product_sync_job_%'
AND ( option_value LIKE '%\"status\":\"queued\"%' OR option_value LIKE '%\"status\":\"processing\"%' )
ORDER BY option_id ASC
LIMIT 1;Can you check and fix the same as well, please?
Hi,
Please check the comparison of rows examined with and without wildcard
With wild card (1.8 Million rows examined):
MariaDB [XXXXXX]> EXPLAIN SELECT * FROM wp_as3cf_items WHERE (path LIKE '%uploads/2025/07/BVPK000273-2201478-1-300x300.webp' OR original_path LIKE '%uploads/2025/07/BVPK000273-2201478-1-300x300.webp');
+------+-------------+----------------+------+---------------+------+---------+------+---------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+----------------+------+---------------+------+---------+------+---------+-------------+
| 1 | SIMPLE | wp_as3cf_items | ALL | NULL | NULL | NULL | NULL | 1829871 | Using where |
+------+-------------+----------------+------+---------------+------+---------+------+---------+-------------+
1 row in set (0.000 sec)Same Query Without wildcard (Only 2 rows examined)
MariaDB [XXXXXX]> EXPLAIN SELECT * FROM wp_as3cf_items WHERE (path LIKE 'uploads/2025/07/BVPK000273-2201478-1-300x300.webp' OR original_path LIKE 'uploads/2025/07/BVPK000273-2201478-1-300x300.webp');
+------+-------------+----------------+-------------+------------------------------+------------------------------+---------+------+------+-------------------------------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+----------------+-------------+------------------------------+------------------------------+---------+------+------+-------------------------------------------------------------+
| 1 | SIMPLE | wp_as3cf_items | index_merge | uidx_path,uidx_original_path | uidx_path,uidx_original_path | 762,762 | NULL | 2 | Using sort_union(uidx_path,uidx_original_path); Using where |
+------+-------------+----------------+-------------+------------------------------+------------------------------+---------+------+------+-------------------------------------------------------------+
1 row in set (0.000 sec)This is a big difference.
Hi @dbisupport
As it is a high traffic website and debug.log file is getting really heavy, can you provide me with any strings which you’re looking for in debug logs, please?
For the record, we are using the following Redis configuration:
define( 'WP_REDIS_CONFIG', [
'token' => "XXXX",
'host' => '/var/run/redis/redis.sock',
'port' => 0,
'scheme' => 'unix',
'database' => "XXXX",
'timeout' => 2.5,
'read_timeout' => 2.5,
'split_alloptions' => true,
'async_flush' => true,
'client' => 'phpredis',
'compression' => 'zstd',
'serializer' => 'igbinary',
'prefetch' => false,
'non_prefetchable_groups' => [ 'as3cf', 'yith_wcbm_badges' ],
'debug' => false,
'save_commands' => false,
'prefix' => DB_NAME,
] );
define( 'WP_REDIS_DISABLED', false );Additionally, sometimes we don’t prefer to use Redis (object-cache-pro) due to conflicts and other reasons. Does that mean this plugin amazon-s3-and-cloudfront-pro will cause thousands of slow queries if we stop using Redis?
Looking forward to your quick response. Thanks!
- This reply was modified 7 months, 2 weeks ago by sushantchawla2005.
Hi,
This is urgent, can someone respond to this issue please?
Hi @vinkmeta Just wanted to follow up on this issue, please confirm if we can expect a new release with the fix this week?
Thanks for your response @vinkmeta I will look forward to your confirmation when the new release would be rolled out with the fix in a week’s time.