opcode 缓存器/优化器 Opcode XCache

码农软件 · 软件分类 · 缓存系统 · 2019-08-30 23:13:07

软件介绍

XCache 是一个开源的 opcode 缓存器/优化器, 这意味着他能够提高您服务器上的 PHP 性能. 他通过把编译 PHP 后的数据缓冲到共享内存从而避免重复的编译过程, 能够直接使用缓冲区已编译的代码从而提高速度. 通常能够提高您的页面生成速率 2 到5 倍, 降低服务器负载.

XCache 工程由 mOo 领队, 他也是 Lighttpd 的开发成员之一. Lighttpd 是最快的 Web 服务器应用程序之一, 并且超越 Apache 以及许多其他 Web 服务器. XCache 努力达到类似的效果.

示例代码:

<?php
define(TMPDIR, '/tmp');

function load_abc_data()
{
  if (xcache_isset("abc_data")) {
    return xcache_get("abc_data");
  }
  // it worth a lock here to avoid useless yet harmful concurrent 
  // load from any slow backend (backend=mysql here).
  $fp = fopen(TMPDIR . "/abc_data.lock", "w");
  flock($fp, LOCK_EX);
  // check AGAIN after we get the lock
  if (xcache_isset("abc_data")) {
    fclose($fp);
    return xcache_get("abc_data");
  }
  mysql_query .... and get $data
  xcache_set("abc_data", $data, 120); // save for 2 minutes
  fclose($fp);
  return $data;
}

?>

本文地址:https://www.codercto.com/soft/d/13537.html

Algorithm Design

Algorithm Design

Jon Kleinberg、Éva Tardos / Addison-Wesley / 2005-3-26 / USD 144.20

Algorithm Design introduces algorithms by looking at the real-world problems that motivate them. The book teaches students a range of design and analysis techniques for problems that arise in compu......一起来看看 《Algorithm Design》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具