Почему бы вам не запустить некоторые тесты и затем распределить эту нагрузку !!
http://www.php.net/manual/en/intro.apc.php
Page generated in 0.003202 secs using 2 DB calls and 0 DBCache hits (users ttl=5 countries ttl=5 and both items have expired)
Page generated in 0.002728 secs using 1 DB calls and 1 DBCache hits (users ttl=5 countries ttl=immortal and users has expired)
Page generated in 0.000067 secs using 0 DB calls and 2 DBCache hits (users ttl=5 countries ttl=immortal and both are fetched from cache)
how fast - 0.000067 ouch !!
Пример PHP-скрипта с использованием APC
<?php
require_once "CacheDB.php";
ob_start();
echo "<h3>APC info:</h3>";
print_r(apc_sma_info());
try{
//I assume you've already have a db connection available for the cacheDB to use
$db = @new mysqli("127.0.0.1","foo_dbo","pass","foo_db",3306);
if ($db->connect_errno)
throw new Exception("Could not connect: " . $db->connect_error);
//start the demo...
$startTime = microtime(true);
$cacheDB = new CacheDB($db);
$rows = $cacheDB->Query("call list_users()", CacheDB::TTL_5); //5 second Time To Live (TTL) (30 secs might be more realistic)
if($rows){
echo "<h3>Users:</h3><ul>";
foreach($rows as $row) echo sprintf("<li>%s</li>", $row["username"]);
echo "</ul>";
}
$rows = $cacheDB->Query("call list_countries()", CacheDB::TTL_IMMORTAL); //never expires
if($rows){
echo "<h3>Countries:</h3><ul>";
foreach($rows as $row) echo sprintf("<li>%s</li>", $row["name"]);
echo "</ul>";
}
echo sprintf("<p><b>Page generated in %s secs using %d DB calls and %d DBCache hits</b></p><p>Refresh me !!</p>",
number_format(microtime(true) - $startTime, 6, ".", ""),
$cacheDB->GetDBHits(), $cacheDB->GetCacheHits());
$db->close();
}
catch(Exception $ex)
{
ob_clean();
echo sprintf("zomg borked - %s", $ex->getMessage());
}
//finally
ob_end_flush();
?>