Install Memcache Rumi, November 11, 2012June 20, 2013 By default PHP loads and saves sessions to disk. Disk storage has a few problems: 1. Slow IO: Reading from disk is one of the most expensive operations an application can perform, aside from reading across a network. 2. Scale: If we add a second server, neither machine will be aware of sessions on the other. Enter Memcached I hinted at Memcached before as a content cache that can improve application performance by preventing trips to the database. Memcached is also perfect for storing session data, and has been supported in PHP for quite some time. Why use memcached rather than file-based sessions? Memcache stores all of its data using key-value pairs in RAM – it does not ever hit the hard drive, which makes it F-A-S-T. In multi-server setups, PHP can grab a persistent connection to the memcache server and share all sessions between multiple nodes. Installation Before beginning, you’ll need to have the Memcached server running. I won’t get into the details for building and installing the program as it is different in each environment. On Ubuntu it’s as easy as aptitude install memcached. Most package managers have a memcached installation available. Installing memcache for PHP is hard (not!). Here’s how you do it: pecl install memcache Careful, it’s memcache, without the ‘d’ at the end. Why is this the case? It’s a long story – let’s save the history lesson for another day. When prompted to install session handling, answer ‘Yes’. Usage Using memcache for sessions is as easy as changing the session handler settings in PHP.ini: session.save_handler = memcache session.save_path = “tcp://127.0.0.1:11211″ (assuming memcached is set up to use default port) Now restart apache (or nginx, or whatever) and watch as your sessions are turbo-charged. Install Memcached and php5-memcached apt-get install memcached php5-memcached Related Administrations Configurations (Linux) memcachephpproxy
Mail relaying with Virtualmin August 30, 2010 In a typical Virtualmin configuration, email for domains that you host will be delivered to mailboxes on the system for reading by users using Usermin or an IMAP client like Outlook or Thunderbird. However, in come cases you may want mail ultimately delivered to another server, such as an Exchange box… Read More
Install Zabbix 5.x Monitoring Server on Ubuntu 20.04 June 24, 2023 Zabbix is a free, open-source, and high-performance monitoring tool for servers, applications, and network devices. It uses agents to collect system metrics. It also monitors standard services such as SMTP or HTTP services and supports host monitoring via SNMP, TCP, and ICMP checks. It is designed for real-time monitoring of… Read More
Extend/Reduce LVM’s (Logical Volume Management) in Linux March 15, 2020 My Server Setup – Requirements Operating System – CentOS 6.5 with LVM Installation Server IP – 192.168.0.200 How to Extend Volume Group and Reduce Logical Volume Logical Volume Extending Currently, we have One PV, VG and 2 LV. Let’s list them one by one using following commands. # pvs #… Read More