Posted by ball.in.th on October 27, 2009 at 12:26pm
2 followers
Jump to:
| Project: | Cache |
| Version: | 6.x-1.0-beta1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi,
I am getting assertion warnings:
assert() [function.assert]: Assertion failed in /home/xxxx/public_html/sites/all/modules/cache/engines/memcache.inc on line 155.
At first I thought this would occur only on big pages, hitting 1M limit for memcache, but now it occurs on small pages as well.
Comments
#1
Also, on line 141:
assert() [function.assert]: Assertion failed in /home/ballinth/public_html/sites/all/modules/cache/engines/memcache.inc on line 141.
#2
For assertion on line 141, it seems to be related to long URL's which might be too long as a key for cache_page with memcache. On my site some URL's are in Thai so they can be really long, e.g., http://ball.in.th/profile/profile_interest/%E0%B8%AB%E0%B8%99%E0%B8%B1%E... .
#3
I had the same error with memcache and assert and have just shorter URLs.
I ended up commenting out that assert line in memcache.inc and that fixed it.
I think the assert function is more a test than required so everything works as normal.
#4
Hi,
If you got assertion on line 155, it might mean that the lookup table is too big for memcache, which is not so good. Assertion on line 141 might mean the key is too long or the data is too big, also not good.
#5
@ball.in.th So your recommendation would be?
#6
For assertion on line 155, my guess is that it's better to use 'flush_all' option in engine configuration to avoid the lookup table altogether. The lookup table doesn't seem to scale very well with many keys anyway. The downside is that a flush will clear everything in the bin, including unexpired ones. This means you need a separate memcache server for a particular bin.
For assertion on line 141, the keys need to be shorter or enabling compression option might help. It might be difficult to find which module is causing the asserts though.
So here's a sample of my engine configuration:
<?php'memcache-engine1' => array( // should have 1 engine for 1 bin
'engine' => 'memcache',
'server' => array(
'localhost:11211',
),
'shared' => FALSE,
'prefix' => '',
'flush_all' => TRUE,
'compress' => TRUE,
),
?>