K uložení počtu bych použil memcached a pak ho synchronizoval s databází v cronu...
// Increment
$page_id = 1;
$memcache = new Memcache();
$memcache->connect('localhost', 11211);
if (!$memcache->get('page_' . $page_id)) {
$memcache->set('page_' . $page_id, 1);
}
else {
$memcache->increment('page_' . $page_id, 1);
}
// Cron
if ($pageviews = $memcache->get('page_' . $page_id)) {
$sql = "UPDATE pages SET pageviews = pageviews + " . $pageviews . " WHERE page_id = " . $page_id;
mysql_query($sql);
$memcache->delete('page_' . $page_id);
}