Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#71 closed defect (fixed)

even inode number result in hashing issue for cacheid (was php#0 (any one) bolck doesnt work.)

Reported by: Nneel Owned by: moo
Priority: major Milestone: 1.2.1
Component: cacher Version:
Keywords: Cc:
Application: vbulletin 3.6.4 PHP Version: 5.2.0
Other Exts: SAPI: FastCGI
Probability: Blocked By:
Blocking:

Description (last modified by moo)

we are on vbulletin 3.6.4
cPanel+Apache 1.3.37+CentOS 4(Redhat AS4) +Dual Operton 248
vBulletin3.6.4+Php5.2.0
Xcache 1.2.0 (the last release stable one)

helo..here is a screen shot of our xcache admin
http://img169.imageshack.us/img169/2828/xcbf4.jpg

as per Jasons instruction im submitting this bug
http://www.vbulletin.com/forum/showthread.php?p=1309421&highlight=memcache#post1309421
here is our php info
http://www.golpo.net/test111.php?info=1

our xcache.ini

===============================================================
; select low level shm/allocator scheme implemenation
xcache.shm_scheme =        "mmap"
xcache.size  =                64M
xcache.count =                 2
xcache.slots =                8K
xcache.ttl   =                 0
xcache.gc_interval =           0

; same as aboves but for variable cache
xcache.var_size  =            16M
xcache.var_count =             2
xcache.var_slots =            8K
; default ttl
xcache.var_ttl   =             0
xcache.var_maxttl   =          0
xcache.var_gc_interval =     300

xcache.test =                Off
; N/A for /dev/zero
xcache.readonly_protection = Off
xcache.mmap_path =    "/dev/zero"
cking open_basedir)
xcache.coredump_directory =   ""
xcache.cacher =               On
xcache.stat   =               On
xcache.optimizer =           On
[xcache.coverager]
xcache_coverager_start/stop/get/clean() 
xcache.coverager =          Off
xcache.coveragedump_directory = ""
==============================================================

unless set:
xcache.stat = Off
both php arent working. and if xcache.stat is off..every time..after change anything(templateacp) need to clear the cache & have to wait for re-cache.

but what is the sulotion?

Change History (23)

comment:1 Changed 7 years ago by Nneel

and more

xcache.var also not working in the same enviornment.

comment:2 Changed 7 years ago by Nneel

Helo ..im updating the report with more info...incase if its help to solve it

Here is the new screen shot of our Xcache admin
Screen shot :
http://img480.imageshack.us/img480/7400/xc2bp8.jpg

i increased
xcache.size = 96M [it was 64M]

to reduce MISSES qty.Its already 852.

I have already provide the link(vbulletin.com) of discussion where we tried to fix it.
If Xcache.stat turned OFF. every time cache need to clear to cache new changed template.[any change even its from ACP]

And its not caching any VAR. tho i allocate 16 MB for var cache.

details of our phpinfo can be found here
http://www.golpo.net/test111.php?info=1

we are wellprepared to co-operate.

Thnx

comment:3 Changed 7 years ago by moo

  • Description modified (diff)
  • Status changed from new to assigned

comment:4 Changed 7 years ago by Mudvayne

Facing the same problem. I've also increased the total memory to 96 MB. Thanks a lot Nneel for this temporary solution :).

comment:5 Changed 7 years ago by litkaj

Nneel,

Just as an update to this, as I've already said over on vBulletin.com, the var cache does not do what you think it does. Unless you rewrite your code to take advantage of it, it should stay disabled.

Likewise, misses are normal because every file that is requested that has not already been cached will register as a miss. You can either increase the cache size or set a TTL to clean out old entries. In either case though, there will always be at least as many misses as there are files cached.

Jason|Xoxide from vBulletin.com Forums

comment:6 Changed 7 years ago by Nneel

Thans a lot Jason...to be here .

Yes with proper honor i read your reply over vb.com.
when there are an opportunity to get advantages of "var.cache"
why not we use it ?

As we are dependable on Author or some one who knows verywell about Xcache..
Getting a proper guideline would be higly appriciated.


As both php block doesnt working so to cache all i increased Cache size to
96MB(48 MB X 2 block = 96MB),Here just 48MB are using.And upto now 10MB still free.And if necessary i can increase more Ram.(Maybe its not the solution)

Regarding xcache.gc_interval .when some one out of ram usualy think about the GC.Interval to clean out the old garbage.


Can you show the code change/re-write how to take advantages of Var.Cache.

Thakx a lot.

comment:7 Changed 7 years ago by moo

hrm... before reproduce the bug, i guess stat() failed on your box, are u using smbfs/nfs or so? or any other fs that do not support inode?

$ stat a.php
$ stat b.php

see if they have same or 0 inode

example output:

  File: `mrxvt.exe'
  Size: 639461      Blocks: 628        IO Block: 1024   regular file
Device: 9483159fh/2491618719d   Inode: 23362423067037250  Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1003/  moo)   Gid: (  513/    users)
Access: 2007-02-23 01:14:13.724667600 +0800
Modify: 2007-02-16 17:50:35.803478000 +0800
Change: 2007-02-23 01:14:08.376978000 +0800

comment:8 Changed 7 years ago by moo

u'd better check inode in php list that showing in XCache admin page

btw, if u have patch that apply to vbb or any other opensource project to make it make use of xcache var cache, u can push it to its official and/or post it in XCache wiki

comment:9 Changed 7 years ago by Nneel

I better get off about the topic for var.cache. I will open another ticket.
Hence this ticket is for another issue.

Thnx for ur reply. Any ETA about the solution of related topic?

comment:10 Changed 7 years ago by moo

as soon within 1 day after u give useful feedback to my questions.

can u show a list of php what showing in admin page? and what fs(file system) is the *.php files settle? i assume you're using *nix

comment:11 Changed 7 years ago by Nneel

Thanx Mr.Author

Pls see the screen shot bellow

S.Sshot-1:http://img118.imageshack.us/img118/2078/inodent0.jpg

S.Sshot-2: http://img119.imageshack.us/img119/6122/in2jt7.jpg

or for ur better investigation i can give u Admin page access user & pass.
do u mind to give me ur mail id.So that i can mail u the info.
u understand i can put that info here.

comment:12 Changed 7 years ago by Nneel

edit:
sorry i cant put access info here.
its public place.
Sorry for wrong post.
we are on vps.
OS: Cent OS 4.CentOS 4(Redhat AS4)

comment:13 Changed 7 years ago by moo

phpxcache@…, u may also give me a temp ssh account if possible for some days.

the inodes in pics looks fine except the whole second entry in the 2nd pic

comment:14 Changed 7 years ago by Nneel

For your more informationn
we are using a template cache module by Orban
from vbulletin.com

http://www.vbulletin.org/forum/showthread.php?t=121876

if you want to have a look on this mod.pls grab it

http://nneel.net/template_cache.zip

Please be informed that.Before using this module,we also face the same problem.
Before & after use the hack the problem is same.After using it Xcache is caching more files.
the author of that mod (Orban) also using Xcache.But i dont know hes facing the same problem (like us) or not.

http://www.vbulletin.org/forum/showthread.php?t=121876&page=18

Mail Send. Please confirm you have received the mail.

comment:15 Changed 7 years ago by moo

  • Summary changed from php#0 (any one) bolck doesnt work . to even inode number result in hashing issue for cacheid (was php#0 (any one) bolck doesnt work.)

comment:16 Changed 7 years ago by moo

Patch pending

  • xcache.c

     
    739739{ 
    740740#ifdef HAVE_INODE 
    741741   if (xce->inode) { 
    742        return HASH(xce->device + xce->inode); 
     742       return HASH(xce->device + (xce->inode >> 1)); 
    743743   } 
    744744#endif 
    745745   return xc_entry_hash_name(xce TSRMLS_CC); 
Index: xcache.c
===================================================================
--- xcache.c    (revision 354)
+++ xcache.c    (working copy)
@@ -739,7 +739,7 @@
 {
 #ifdef HAVE_INODE
    if (xce->inode) {
-       return HASH(xce->device + xce->inode);
+       return HASH(xce->device + (xce->inode >> 1));
    }
 #endif
    return xc_entry_hash_name(xce TSRMLS_CC);

but i wonder what's going on with your inode numbers

comment:17 Changed 7 years ago by Dhillon

I am on similar specs as Mneel and having similar problem,
oh and i couldn't find this line 'return HASH(xce->device + xce->inode);' in xcache.c

comment:18 Changed 7 years ago by moo

the patch is for trunk. for 1.2.0: search for

static inline xc_hash_value_t xc_entry_hash_php(xc_entry_t *xce TSRMLS_DC) /* {{{ */                                                                            {
#ifdef HAVE_INODE
    if (xce->data.php->inode) {
        return HASH(xce->data.php->device + xce->data.php->inode);
    }                                                                           #endif

comment:19 Changed 7 years ago by Dhillon

Now I am getting these errors with or without applying the patch

checking build system type... Invalid configuration `.enable-xcache': machine `.enable' not recognized
configure: error: /bin/sh ./config.sub .enable-xcache failed

comment:20 Changed 7 years ago by moo

it's not XCache problem, but your src.rpm issue

comment:21 Changed 7 years ago by litkaj

I wasn't able to replicate that glitch with my src.rpm (which I am fairly certain is the only one). However, I have updated my site to have an src.rpm that applies the patch below.

--- xcache.c.bak        2007-02-23 09:40:13.000000000 -0600
+++ xcache.c    2007-02-23 09:40:45.000000000 -0600
@@ -690,7 +690,7 @@
 {
 #ifdef HAVE_INODE
        if (xce->data.php->inode) {
-               return HASH(xce->data.php->device + xce->data.php->inode);
+               return HASH(xce->data.php->device + (xce->data.php->inode >> 1));
        }
 #endif
        return xc_entry_hash_name(xce TSRMLS_CC);

That should work, right?

comment:22 Changed 7 years ago by moo

  • Resolution set to fixed
  • Status changed from assigned to closed

fixed in [356] for branches/1.2

comment:23 Changed 7 years ago by moo

nope, it was [358], and also fixed in [359] for trunk

Note: See TracTickets for help on using tickets.