tawabwp
Forum Replies Created
-
I also shortened by
WP_CACHE_KEY_SALT:according to a LLM:The long salt and prefix caused real overhead. What your Redis was actually doing
Your keys looked like this:
msOrZN^=;#0M<*cwh=N/_=o8uH#~qF%, rdMPe)F5f XS/Y4&A$NBa}?;;5=PT-rwp:options:alloptionsThat means:
- ~70–80 extra bytes per key
- ~540,000 keys
- Tens of MB of pure string overhead
- Every
SCAN MATCH, LuaEVAL, and prefix comparison had to process that junk
Now combine that with:
- WooCommerce plugins doing group flush
- Redis Object Cache using Lua loops
- SCAN running repeatedly
Result: Redis CPU spikes and latency explosions.
I am going to monitor the latency in the next couple of days, will share my findings in this thread, hopefully this will help someone in the future.
Alright, I’ve enabled
WP_REDIS_DISABLE_GROUP_FLUSHand changed the key prefix to (webshopname_redis). Lets see how this behaves.I’m still a bit skeptical though. It feels like something is going wrong under the hood, possibly caused by a WooCommerce plugin thats generating an excessive number of keys. Thats just a gut feeling for now.
redis-cli -s slowlog get 3:
1) 1) (integer) 449002
2) (integer) 1767035315
3) (integer) 521667
4) 1) "EVAL"
2) " local cur = 0\n local i = 0\n local tmp\n repeat\n t... (459 more bytes)"
3) "0"
5) "/home/anonymized/.redis/redis.sock:0"
6) ""
2) 1) (integer) 449001
2) (integer) 1767035314
3) (integer) 560053
4) 1) "EVAL"
2) " local cur = 0\n local i = 0\n local tmp\n repeat\n t... (459 more bytes)"
3) "0"
5) "/home/anonymized/.redis/redis.sock:0"
6) ""
3) 1) (integer) 449000
2) (integer) 1767035314
3) (integer) 511976
4) 1) "EVAL"
2) " local cur = 0\n local i = 0\n local tmp\n repeat\n t... (459 more bytes)"
3) "0"
5) "/home/anonymized/.redis/redis.sock:0"
6) ""Ok, I added the setting in my wp-config.php.
Additionally, the spike is happening right now, I will send some details maybe it will show something.redis cli –latency:
min: 0, max: 1177, avg: 61.49 (297 samples)
Db size:(integer) 534296redis cli –big keys shows:
-------- summary -------
Total key length in bytes is 69416618 (avg len 127.69)
Biggest string found "msOrZN^=;#0M<*cwh=N/_=o8uH#~qF%, rdMPe)F5f XS/Y4&A$NBa}?;;5=PT-rwp:options:alloptions" has 1458298 bytes
Biggest zset found "msOrZN^=;#0M<*cwh=N/_=o8uH#~qF%, rdMPe)F5f XS/Y4&A$NBa}?;;5=PT-rwp:redis-cache:metrics" has 5064 members
0 lists with 0 items (00.00% of keys, avg size 0.00)
0 hashs with 0 fields (00.00% of keys, avg size 0.00)
0 streams with 0 entries (00.00% of keys, avg size 0.00)
543643 strings with 327757497 bytes (100.00% of keys, avg size 602.89)
0 sets with 0 members (00.00% of keys, avg size 0.00)
1 zsets with 5064 members (00.00% of keys, avg size 5064.00)# Memory
used_memory:483399128
used_memory_human:461.01M
used_memory_rss:527470592
used_memory_rss_human:503.04M
used_memory_peak:711369600
used_memory_peak_human:678.41M
used_memory_peak_time:1766945326
used_memory_peak_perc:67.95%
used_memory_overhead:44428725
used_memory_startup:651656
used_memory_dataset:438970403
used_memory_dataset_perc:90.93%
allocator_allocated:484030072
allocator_active:504303616
allocator_resident:527314944
allocator_muzzy:0
total_system_memory:66800857088
total_system_memory_human:62.21G
used_memory_lua:41984
used_memory_vm_eval:41984
used_memory_lua_human:41.00K
used_memory_scripts_eval:1552
number_of_cached_scripts:2
number_of_functions:0
number_of_libraries:0
used_memory_vm_functions:32768
used_memory_vm_total:74752
used_memory_vm_total_human:73.00K
used_memory_functions:192
used_memory_scripts:1744
used_memory_scripts_human:1.70K
maxmemory:16000000000
maxmemory_human:14.90G
maxmemory_policy:allkeys-lru
allocator_frag_ratio:1.04
allocator_frag_bytes:20141192
allocator_rss_ratio:1.05
allocator_rss_bytes:23011328
rss_overhead_ratio:1.00
rss_overhead_bytes:155648
mem_fragmentation_ratio:1.09
mem_fragmentation_bytes:44051168
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_total_replication_buffers:0
mem_replica_full_sync_buffer:0
mem_clients_slaves:0
mem_clients_normal:685149
mem_cluster_links:0
mem_aof_buffer:0
mem_allocator:jemalloc-5.3.0
mem_overhead_db_hashtable_rehashing:0
active_defrag_running:0
lazyfree_pending_objects:0
lazyfreed_objects:5644140(integer) 320512Forum: Plugins
In reply to: [Gwolle Guestbook] Emoji not displaying + FIXSolution written above!
For version(s) 7.4.x and above, you need to comment out
$useApiTitleThis question might be a duplicate of:
https://ww.wp.xz.cn/support/topic/retrieve-the-gateway-title-from-mollie-option-not-working/
and
https://ww.wp.xz.cn/support/topic/select-your-bank-not-translated-english-dutch/
however, the proposed solutions do not seem to work in version 7.4.0. Since there is no$titleIsDefaultinmollie-payments-for-woocommerce/src/PaymentMethods/AbstractPaymentMethod.phpInstead, I have figured out how to fix it myself.
If you comment out// if ($useApiTitle || $title === false) {
// return $this->getApiTitle();
// }Inside the
public function title()function, then the string is used which you can specify inside Woocommerce -> Settings -> Payment tab.
This fixed it for me! Hope this can be used as reference for future developers!Thanks for the reply!
Yes, I think explaining in the disclaimer that “In WooCommerce, by default, an order can only have a single order status at any given time” is very important for non-technical people.
So they understand why only one product can determine the order status.You mean in the scenario when there is 1 order with 2 different products? and based on those products, each product is linked to a different status?
In WooCommerce, by default, an order can only have a single order status at any given time. However, you can create custom order status labels and assign them to orders as needed.Nevertheless, even though you can attach multiple order statuses to an order, only one status will be displayed at a time in the WooCommerce admin and on the order details page.
Therefore, the order status should default to the first product, and no other option is possible.
I think most people who understand woocommerce will get this, but for others who don’t, perhaps it’s good to explain in the docs.
As long as the option is there for a product or category, it would already be a great improvement- This reply was modified 3 years ago by tawabwp.
How did you solve it?
I see on your website that you solved it using another plugin is that correct?
Forum: Plugins
In reply to: [WooCommerce] Display category image and featured image on ArchiveI have somewhat edited your code. This should work:
/** * Display category image on category archive */ add_action('woocommerce_archive_description', 'woocommerce_category_image', 2); function woocommerce_category_image(){ if (is_product_category()) { global $wp_query; $cat = $wp_query->get_queried_object(); $thumbnail_id = get_term_meta($cat->term_id, 'thumbnail_id', true); $image = wp_get_attachment_url($thumbnail_id); if ($image){ echo '<img src="'.$image.'" alt="'.$cat->name.'"/>'; } } }- This reply was modified 5 years, 3 months ago by tawabwp.