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

The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and

The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and

Jeremy Kubica / No Starch Press / 2016-8-15 / USD 13.74

Meet Frank Runtime. Disgraced ex-detective. Hard-boiled private eye. Search expert.When a robbery hits police headquarters, it's up to Frank Runtime and his extensive search skills to catch the culpri......一起来看看 《The CS Detective: An Algorithmic Tale of Crime, Conspiracy, and 》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

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

URL 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器