memcached

Мы предоставляем услуги удаленного администрирования серверов

memcached

FacebookTwitterVK
Memcached —

простыми словами

программный продукт, позволяющий программисту кэшировать данные обработки в оперативной памяти, тем самым, ускорять работу приложения и снижать нагрузку на сервер.

Распространенное применение — кэширование результатов обработки PHP. Таким образом, ускоряется обработка скриптов веб-сервером, что позволяет веб-приложению грузиться быстрее. При этом, memcached можно настроить как на самом веб-сервере, так и в виде отдельного сервера, принимающего запросы и сохраняя их в кэше.

Пример php-скрипта с фрагментом использования memcached:

// Подключаемся к Memcache
$memcache = new Memcache;
$memcache->connect(‘localhost’,11211);
$key = 1;
 
// Проверяем кэш по ключу     
$getResult = $memcache->get($key);

// Если есть, используем, если нет, получаем данные и заносим в кэш
if ($getResult) {
    $resultData = array();
    $resultData = $getResult;
} else {
    $data = …
    $memcache->set($key, $data, false, 86400);
}

Memcached можно установить на большинство систем UNIX (например, FreeBSD, CentOS, Ubuntu), а также Windows.

Подробнее о memcached на Википедии


Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/.maintenance) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-includes/load.php on line 306

Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/wp-content/plugins/amp/assets/css/amp-default.css) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-content/plugins/amp/includes/sanitizers/class-amp-style-sanitizer.php on line 1282

Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/wp-includes/Requests/Cookie/Jar.php) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-includes/class-requests.php on line 145

Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/tree.class.php) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/folders.class.php on line 2669

Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/form.class.php) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/folders.class.php on line 2669

Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/class-wpml.php) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/folders.class.php on line 2669

Warning: file_exists(): open_basedir restriction in effect. File(/home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/class-polylang.php) is not within the allowed path(s): (/home/rsa/sites/dev.admins24.com:.) in /home/rsa/sites/admins24.com/wp-content/plugins/folders/includes/folders.class.php on line 2669

Fatal error: Uncaught Error: Class 'Requests_Cookie_Jar' not found in /home/rsa/sites/admins24.com/wp-includes/class-requests.php:591 Stack trace: #0 /home/rsa/sites/admins24.com/wp-includes/class-requests.php(365): Requests::set_defaults('https://admins2...', Array, NULL, 'GET', Array) #1 /home/rsa/sites/admins24.com/wp-includes/class-http.php(394): Requests::request('https://admins2...', Array, NULL, 'GET', Array) #2 /home/rsa/sites/admins24.com/wp-includes/class-http.php(626): WP_Http->request('https://admins2...', Array) #3 /home/rsa/sites/admins24.com/wp-includes/http.php(162): WP_Http->get('https://admins2...', Array) #4 /home/rsa/sites/admins24.com/wp-content/plugins/amp/src/RemoteRequest/WpHttpRemoteGetRequest.php(114): wp_remote_get('https://admins2...', Array) #5 /home/rsa/sites/admins24.com/wp-content/plugins/amp/src/RemoteRequest/CachedRemoteGetRequest.php(125): AmpProject\AmpWP\RemoteRequest\WpHttpRemoteGetRequest->get('https://admins2...') #6 /home/rsa/sites/admins24.com/wp-content/plugins/amp/includes/sanit in /home/rsa/sites/admins24.com/wp-includes/class-requests.php on line 591