Custom Query (302 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (7 - 9 of 302)

1 2 3 4 5 6 7 8 9 10 11 12 13
Ticket Resolution Summary Owner Reporter
#335 invalid whitelist auth for admin functions moo godog
Description

Hi, thanks for xcache!

I was trying to get some stats out and was wondering if some of the admin functions could be whitelisted (say via config, via a list of functions) to not require auth, e.g. if you are trying to get statistics out (say towards a monitoring platform) then they are effectively read-only (xcache_count and xcache_info). Whitelist rationale being that calling these functions just gets data out.

thanks!

I've come up with sth like this:

$EXPORTED_STATS = array(
  "compiling", "disabled", "misses", "hits", "clogs",
  "ooms", "errors", "cached", "deleted", "size", "avail"
);

function xcache_type_stats($type) {
  global $EXPORTED_STATS;

  $total = array();
  $type_stats = array();

  for ($i = 0; $i < xcache_count($type); $i++) {
    $type_stats[] = xcache_info($type, $i);
  }

  foreach($type_stats as $unused => $type_stat) {
    foreach($type_stat as $k => $v) {
      if(!in_array($k, $EXPORTED_STATS)) {
        continue;
      }

      if(!isset($total[$k])) {
        $total[$k] = 0;
      }
      $total[$k] += $v;
    }
  }
  return $total;
}
#334 invalid XCache: Cannot create shm in Unknown on line 0 moo snetts
Description

Hello,

I have Xcache installed on my site and I keep getting this error each time the page reloads. I guess you know what this means, I have an error log that is very big and I have to delete it all the time.

When I check the log this is what I find:

Unknown on line 0 [14-Dec-2013 19:08:03] PHP Fatal error: XCache: Cannot create shm in Unknown on line 0 [14-Dec-2013 19:08:03] PHP Fatal error: XCache: Cannot init in Unknown on line 0

#333 fixed Memory usage keeps growing while repeatedly require() the same empty file moo xubin04
Description

Hi, mOo, thanks for your great work and insistency during the past several years on Xcache, We've been using Xcache since its early versions, after upgrading Xcache from 1.3.2 to 3.0.4 recently, we met with a possible memory management issue in Xcache.

Code:

a.php

<?php
      for ($i=0; $i<10000; $i++) {
            require('b.php');
            printf('%d\n",  memory_get_usage());
      }

b.php

<?php
// this could be an empty file

Then, we run a.php with the following command:

php -d xcache.test=on a.test

(I set xcache.test=on since Xcache doesn't enable cache under CLI mode by default)

and then the memory usage keeps growing:

224184
224512
224808
225104
225400
225696
225992
226288
226584
226880
227176
227472
227768
228064
...............

I agree it's far from PHP's best practices to include a file repeatedly, however, can we avoid extra memory allocation in such circumstances? The allocation seems to be reside in xc_cacher.c:

2147     /* found entry */
2148     if (stored_entry && stored_php) {
2149         zend_llist_add_element(&CG(open_files), h);
2150         return xc_compile_restore(stored_entry, stored_php TSRMLS_CC);
2151     }

Is this a bug or something 'have to be so' ? Is there an approaches we can bypass this issue if the application code is beyond our control?

Regards!

This is my PHP version info:

PHP 5.4.21 (cli) (built: Dec  6 2013 19:30:14)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with XCache v3.0.4, Copyright (c) 2005-2013, by mOo
    with XCache Cacher v3.0.4, Copyright (c) 2005-2013, by mOo
1 2 3 4 5 6 7 8 9 10 11 12 13
Note: See TracQuery for help on using queries.