Changeset 936
- Timestamp:
- 06/28/2012 09:45:40 AM (11 months ago)
- Location:
- trunk
- Files:
-
- 8 modified
-
admin/common-zh-simplified-utf-8.lang.php (modified) (1 diff)
-
admin/common-zh-traditional-utf-8.lang.php (modified) (1 diff)
-
admin/help-en.lang.php (modified) (1 diff)
-
admin/help-zh-simplified-utf-8.lang.php (modified) (1 diff)
-
admin/help-zh-traditional-utf-8.lang.php (modified) (1 diff)
-
admin/xcache.tpl.php (modified) (3 diffs)
-
xcache.c (modified) (17 diffs)
-
xcache.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/common-zh-simplified-utf-8.lang.php
r605 r936 36 36 'Hits/S' 37 37 => '命中/S', 38 ' Misses'39 => ' 错过',38 'Updates' 39 => '更新', 40 40 'Clogs' 41 41 => '阻塞', -
trunk/admin/common-zh-traditional-utf-8.lang.php
r605 r936 36 36 'Hits/S' 37 37 => '命中/S', 38 ' Misses'39 => ' 錯過',38 'Updates' 39 => '更新', 40 40 'Clogs' 41 41 => '阻塞', -
trunk/admin/help-en.lang.php
r605 r936 11 11 <dt><?php echo _T('Hits 24H'); ?>: </dt><dd>Hits 24 Hours. Hits graph of last 24 hours</dd> 12 12 <dt><?php echo _T('Hits/S'); ?>: </dt><dd>Average Hits per Second. Only last 5 seconds is logged</dd> 13 <dt><?php echo _T(' Misses'); ?>: </dt><dd>Cache Misses, miss=a var/php is requested but not in the cache</dd>13 <dt><?php echo _T('Updates'); ?>: </dt><dd>Cache Updates, miss=a var/php is requested but not in the cache</dd> 14 14 <dt><?php echo _T('Clogs'); ?>: </dt><dd>Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked) when the cache is busy compiling already</dd> 15 15 <dt><?php echo _T('OOMs'); ?>: </dt><dd>Out Of Memory, how many times a new item should be stored but there isn't enough memory in the cache, think of increasing the xcache.size or xcache.var_size</dd> -
trunk/admin/help-zh-simplified-utf-8.lang.php
r605 r936 11 11 <dt><?php echo _T('Hits 24H'); ?>: </dt><dd>24 小时命中分布图. 图表现是最后 24 小时的命中次数</dd> 12 12 <dt><?php echo _T('Hits/S'); ?>: </dt><dd>每秒命中次数. 只统计最后 5 秒</dd> 13 <dt><?php echo _T(' Misses'); ?>: </dt><dd>共享内存错过次数, 错过=请求的php或者变量并不在该共享内存内</dd>13 <dt><?php echo _T('Updates'); ?>: </dt><dd>共享内存更新次数</dd> 14 14 <dt><?php echo _T('Clogs'); ?>: </dt><dd>编译阻塞跳过, 阻塞=当需该共享内存区负责编译时, 其他进程/现成无法访问此共享内存. 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求</dd> 15 15 <dt><?php echo _T('OOMs'); ?>: </dt><dd>内存不足次数, 显示需要存储新数据但是共享内存区内存不足的次数. 如果出现太频繁请考虑加大配置中的 xcache.size 或者 xcache.var_size</dd> -
trunk/admin/help-zh-traditional-utf-8.lang.php
r605 r936 8 8 <dt><?php echo _T('Compiling'); ?>: </dt><dd>編譯標記,當共享記憶體區正在編譯 php 指令時標記為 "yes"</dd> 9 9 <dt><?php echo _T('Hits'); ?>: </dt><dd>共享記憶體命中次數,命中=從該共享記憶體載入php或者變數</dd> 10 <dt><?php echo _T(' Misses'); ?>: </dt><dd>共享記憶體錯過次數,錯過=請求的php或者變數並不在該共享記憶體內</dd>10 <dt><?php echo _T('Updates'); ?>: </dt><dd>共享記憶更新過次數</dd> 11 11 <dt><?php echo _T('Clogs'); ?>: </dt><dd>編譯阻塞跳過,阻塞=當需該共享記憶體區負責編譯時,其他程序/現成無法存取此共享記憶體. 跳過=XCache 自動判斷阻塞的共享記憶體區自動跳過阻塞等待,直接使用非共享記憶體方式繼續處理請求</dd> 12 12 <dt><?php echo _T('OOMs'); ?>: </dt><dd>記憶體不足次數,顯示需要儲存新資料但是共享記憶體區記憶體不足的次數. 如果出現太頻繁請考慮加大配置中的 xcache.size 或者 xcache.var_size</dd> -
trunk/admin/xcache.tpl.php
r931 r936 40 40 <th><?php echo _T('Hits 24H'); ?></th> 41 41 <th><?php echo _T('Hits/S'); ?></th> 42 <th><?php echo _T(' Misses'); ?></th>42 <th><?php echo _T('Updates'); ?></th> 43 43 <th><?php echo _T('Clogs'); ?></th> 44 44 <th><?php echo _T('OOMs'); ?></th> … … 50 50 </tr> 51 51 <?php 52 $numkeys = explode(',', 'slots,size,avail,hits, misses,clogs,ooms,errors,cached,deleted');52 $numkeys = explode(',', 'slots,size,avail,hits,updates,clogs,ooms,errors,cached,deleted'); 53 53 $l_clear = _T('Clear'); 54 54 $l_clear_confirm = _T('Sure to clear?'); … … 117 117 <td><div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td> 118 118 <td>{$hits_avg_s}</td> 119 <td>{$ci[' misses']}</td>119 <td>{$ci['updates']}</td> 120 120 <td>{$ci['clogs']}</td> 121 121 <td>{$ci['ooms']}</td> -
trunk/xcache.c
r931 r936 281 281 if (stored_entry) { 282 282 xc_entry_add_unlocked(cache, entryslotid, stored_entry); 283 ++cache->updates; 283 284 return stored_entry; 284 285 } … … 592 593 add_assoc_long_ex(return_value, ZEND_STRS("slots"), cache->hentry->size); 593 594 add_assoc_long_ex(return_value, ZEND_STRS("compiling"), cache->compiling); 594 add_assoc_long_ex(return_value, ZEND_STRS("misses"), cache->misses); 595 add_assoc_long_ex(return_value, ZEND_STRS("updates"), cache->updates); 596 add_assoc_long_ex(return_value, ZEND_STRS("misses"), cache->updates); /* deprecated */ 595 597 add_assoc_long_ex(return_value, ZEND_STRS("hits"), cache->hits); 596 598 add_assoc_long_ex(return_value, ZEND_STRS("clogs"), cache->clogs); … … 1601 1603 } 1602 1604 /* }}} */ 1603 static zend_op_array *xc_compile_php(xc_compiler_t *compiler, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 1604 { 1605 zend_op_array *op_array; 1605 static void xc_compile_php(xc_compiler_t *compiler, zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 1606 { 1606 1607 zend_uint old_constinfo_cnt, old_funcinfo_cnt, old_classinfo_cnt; 1607 1608 zend_bool catched = 0; … … 1614 1615 old_constinfo_cnt = zend_hash_num_elements(EG(zend_constants)); 1615 1616 1616 compiler->new_php.op_array = NULL;1617 XG(initial_compile_file_called) = 0;1618 1617 zend_try { 1619 op_array = old_compile_file(h, type TSRMLS_CC);1618 compiler->new_php.op_array = old_compile_file(h, type TSRMLS_CC); 1620 1619 } zend_catch { 1621 1620 catched = 1; … … 1626 1625 } 1627 1626 1628 if ( op_array == NULL) {1627 if (compiler->new_php.op_array == NULL) { 1629 1628 goto err_op_array; 1630 1629 } 1631 1630 1632 1631 if (!XG(initial_compile_file_called)) { 1633 return op_array;1632 return; 1634 1633 } 1635 1634 … … 1637 1636 /* {{{ prepare */ 1638 1637 zend_restore_compiled_filename(h->opened_path ? h->opened_path : (char *) h->filename TSRMLS_CC); 1639 compiler->new_php.op_array = op_array;1640 1638 1641 1639 #ifdef HAVE_XCACHE_CONSTANT … … 1819 1817 #endif 1820 1818 1821 return op_array;1819 return; 1822 1820 1823 1821 err_alloc: … … 1830 1828 zend_bailout(); 1831 1829 } 1832 1833 return op_array;1834 1830 } 1835 1831 /* }}} */ … … 1912 1908 */ 1913 1909 1914 zend_op_array *op_array;1915 1910 xc_entry_php_t *stored_entry; 1916 1911 xc_entry_data_php_t *stored_php; … … 1956 1951 } 1957 1952 1958 cache->misses ++;1959 1953 TRACE("miss entry %d:%s", compiler->new_entry.file_inode, compiler->new_entry.entry.name.str.val); 1960 1954 … … 2008 2002 /* }}} */ 2009 2003 2010 op_array = NULL;2011 2004 /* {{{ compile */ 2012 2005 /* make compile inside sandbox */ 2013 xc_sandbox_init(&sandbox, h->opened_path ? h->opened_path : h->filename TSRMLS_CC);2014 2006 2015 2007 #ifdef HAVE_XCACHE_CONSTANT … … 2023 2015 memset(&compiler->new_php.op_array_info, 0, sizeof(compiler->new_php.op_array_info)); 2024 2016 2017 XG(initial_compile_file_called) = 0; 2025 2018 zend_try { 2026 op_array = xc_compile_php(compiler, h, type TSRMLS_CC); 2019 xc_sandbox_init(&sandbox, h->opened_path ? h->opened_path : h->filename TSRMLS_CC); 2020 compiler->new_php.op_array = NULL; 2021 xc_compile_php(compiler, h, type TSRMLS_CC); 2027 2022 } zend_catch { 2028 2023 catched = 1; 2029 2024 } zend_end_try(); 2030 2025 2031 if (catched || !op_array) { 2026 if (catched 2027 || !compiler->new_php.op_array /* possible ? */ 2028 || !XG(initial_compile_file_called)) { 2032 2029 goto err_aftersandbox; 2033 2030 } 2034 2031 2035 /* not cachable */2036 if (!compiler->new_php.op_array) {2037 cache->compiling = 0;2038 /* it's not cachable, but don't scare the users with high misses */2039 cache->misses --;2040 xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC);2041 return op_array;2042 }2043 2032 /* }}} */ 2044 2033 #ifdef SHOW_DPRINT … … 2065 2054 TRACE("%s", stored_entry ? "stored" : "store failed"); 2066 2055 2056 if (catched || !stored_php) { 2057 goto err_aftersandbox; 2058 } 2059 2067 2060 cache->compiling = 0; 2068 if (catched) {2069 goto err_aftersandbox;2070 }2071 2072 2061 xc_free_php(&compiler->new_php TSRMLS_CC); 2073 2062 2074 2063 if (stored_entry) { 2075 if ( op_array) {2064 if (compiler->new_php.op_array) { 2076 2065 #ifdef ZEND_ENGINE_2 2077 destroy_op_array( op_array TSRMLS_CC);2066 destroy_op_array(compiler->new_php.op_array TSRMLS_CC); 2078 2067 #else 2079 destroy_op_array(op_array); 2080 #endif 2081 efree(op_array); 2068 destroy_op_array(compiler->new_php.op_array); 2069 #endif 2070 efree(compiler->new_php.op_array); 2071 compiler->new_php.op_array = NULL; 2082 2072 h = NULL; 2083 2073 } … … 2088 2078 zend_op_array *old_active_op_array = CG(active_op_array); 2089 2079 /* install it */ 2090 CG(active_op_array) = op_array;2080 CG(active_op_array) = compiler->new_php.op_array; 2091 2081 xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC); 2092 2082 CG(active_op_array) = old_active_op_array; 2093 2083 } 2094 return op_array;2084 return compiler->new_php.op_array; 2095 2085 2096 2086 err_aftersandbox: … … 2098 2088 xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 2099 2089 2090 cache->compiling = 0; 2100 2091 if (catched) { 2101 cache->compiling = 0;2102 2092 cache->errors ++; 2103 2093 zend_bailout(); 2104 2094 } 2105 return op_array;2095 return compiler->new_php.op_array; 2106 2096 } 2107 2097 /* }}} */ … … 2839 2829 else { 2840 2830 RETVAL_NULL(); 2841 cache->misses ++;2842 2831 } 2843 2832 } LEAVE_LOCK(cache); … … 3025 3014 zv = (zval *) cache->shm->handlers->to_readwrite(cache->shm, (char *) stored_entry_var->value); 3026 3015 Z_LVAL_P(zv) = value; 3016 ++cache->updates; 3027 3017 break; /* leave lock */ 3028 3018 } -
trunk/xcache.h
r923 r936 261 261 262 262 time_t compiling; 263 zend_ulong misses;263 zend_ulong updates; 264 264 zend_ulong hits; 265 265 zend_ulong clogs;

