Koha Hacks: How to Install Memcached on Koha Library System (Running On Ubuntu 20.04LTS)

Is your Koha server taking too long to catalog or checkout items? Before you break the bank and purchase a bigger server with bucket-loads of RAM and processing power, install Memcached instead – you might just save yourself a lot of time and money!

Koha Hacks: How to Install Memcached on Koha Library System (Running On Ubuntu 20.04LTS)

Is your Koha server taking too long to catalog or checkout items? Before you break the bank and purchase a bigger server with bucket-loads of RAM and processing power, install Memcached instead – you might just save yourself a lot of time and money!

Enable caching with Memcached

Memcached works by storing data in your server’s RAM and serving requests  from the memory cache instead of passing on queries to your database server. This speeds up your application (in this case, Koha) and reduces the load on your SQL database. To install Memcached on your Koha server, do the following (remember to backup your data before your start!):

1. Check if Memcached isn’t installed already

ps -A | grep memcached

If you get a response like 537 ? 00:10:52 memcached then Memcached is already installed and you can skip the installation. You can also go to Home > About Koha to check.

2. Install Memcached

sudo apt update

sudo apt upgrade

sudo apt install memcached

3. Configure Memcached in koha-conf.xml

Koha comes with the section for Memcached already configured but sometimes [email protected]% happens and you have to do it manually. Skip this section if the memcached section is properly configured.

sudo nano /etc/koha/sites/library/koha-conf.xml

where library is the name of your Koha instance. Around line 300 after the <!-- <zebra_loglevels>none,fatal,warn</zebra_loglevels> --> line, you should see the following

<memcached_servers>127.0.0.1:11211</memcached_servers>

<memcached_namespace>koha_library</memcached_namespace>

<template_cache_dir>/var/cache/koha/library/templates</template_cache_dir>

Add these lines if they are missing, replacing ‘library’ with your Koha instance name.

4. Enable and start Memcached

sudo systemctl start memcached.service

5. Check to see that Memcached is running.

Go to Home > About Koha page.

If you configured everything correctly, you should see the following highlighted in green line under Server Information:

Memcached: Servers: 127.0.0.1:11211 | Namespace: koha_demo | Status: running. | Config read from: koha-conf.xml

Tweaking Your Koha Library Server

Pro Tip: You should regularly check Koha’s Home > About Koha page. It gives you a quick overview of your server information. If there are any errors, missing applications or dependencies that might be slowing down your server, they will show up here. Now, read on to find out how to make the most of Koha library system.

Koha ILS About Page

Speed is of the essence in today’s world so it’s important you optimize your Koha library system server to ensure your patrons and staff can do their work quickly and efficiently. Let me if installing Memcached made a difference for you in the comments. And if you need help, don’t hesitate to get in touch. 

Koha Support provides hassle-free Koha installation and cloud hosting as well as training, data migration, customization and technical support. Check out our packages and start your free trial today!

7 Reasons Why You Need an Integrated Library Management System

7 Reasons Why You Need an Integrated Library Management System

Running a library isn’t as simple and straightforward as many people I have encountered think. It’s more than just checking out books and putting them back on the shelf when they are returned. Librarians have to deal other complex, time-consuming responsibilities like acquisitions, cataloguing, inventory, budgets, reports and interlibrary loaning. Pen and paper won’t cut it, and using an excel spreadsheet is only marginally better than digging a trench using a caviar spoon.

read more

How to Quickly Backup Your Koha Database

Regular backups of Koha are a must, in case your installation fails or your hardware crashes. While you should have an automated backup procedure in place, sometimes (before a major upgrade for example) you may need to make a quick one-time backup. So here's how to...

read more
The Top 10 Biggest Libraries in the World

The Top 10 Biggest Libraries in the World

Libraries comes in all types and sizes, from small community libraries that open for a few hours once a week to mega institutions that operate 24 hours a day, 7 days a week. So which are the biggest, most impressive libraries in the world - by catalog size of course;...

read more
Cage Match: Koha Library System vs Athenaeum

Cage Match: Koha Library System vs Athenaeum

If you are shopping around for a new library software, you may have come across Koha and Athenaeum in your web searches. I hope you will find this article helpful as you compare the two and try to make a decision. Despite the Greek sounding name of Athenaeum, both...

read more