Bobcares

Simple Steps to Enable Memcached in DirectAdmin

by | Oct 22, 2024

Memcached in DirectAdmin enhances server performance by caching database queries and reducing load times for faster website response. Our latest blog offers the steps to enable Memcached in DirectAdmin. Bobcares, as a part of our DirectAdmin Support Service offers solutions to every query that comes our way.

Overview
  1. How to Enable Memcached in DirectAdmin?
  2. Steps to Enable Memcached in DirectAdmin
  3. Benefits of Using Memcached in DirectAdmin
  4. Conclusion

How to Enable Memcached in DirectAdmin?

Memcached is a distributed memory object caching technology that is free and open-source. Its goal is to reduce the stress on databases and other external data sources in order to speed up dynamic web applications. Memcached is crucial for various reasons.

  • Performance Improvement: Memcached speeds up application response times and enhances user experience by drastically cutting down on the amount of time required to access frequently used data by caching it in memory.
  • Scalability: Memcached is a vital tool for managing heavy traffic and big datasets because of its distributed architecture, which makes it easy to scale with the expansion of an application.
  • Resource Efficiency: Memcached helps to reduce total resource utilization, which results in a more efficient use of system resources by easing the burden on databases.

With a simple graphical interface, users can easily manage domains, email accounts, databases, files, and server settings with DirectAdmin, a web-based control panel for web hosting setups.

Steps to Enable Memcached in DirectAdmin

1. Install Memcached and Required Packages: We can use the package manager (e.g., yum for CentOS) to install:

enable memcached in directadmin

yum install memcached memcached-devel libmemcached-devel libmemcached

Here,

memcached: The main server.

memcached-devel: Development files needed for the PHP extension.

libmemcached-devel and libmemcached: Client libraries for Memcached.

2. Start and Enable Memcached:

i. Start Memcached:

systemctl start memcached

ii. Enable Memcached on boot:

systemctl enable memcached

iii. For older systems without systemctl:

/etc/init.d/memcached start
chkconfig memcached on

3. Install the Memcached PHP Extension:

i. Then, download and install libmemcached:

wget https://launchpad.net/libmemcached/1.0/1.0.18/+download/libmemcached-1.0.18.tar.gz
gunzip libmemcached-1.0.18.tar.gz
tar -xvf libmemcached-1.0.18.tar
cd libmemcached-1.0.18
./configure
make && make install

ii. Download and install the PHP extension:

wget https://pecl.php.net/get/memcached-3.0.4.tgz
tar -xvzf memcached-3.0.4.tgz
cd memcached-3.0.4
phpize
./configure
make && make install

4. Configure PHP to Use Memcached:

i. Locate the php.ini file:

php -i | grep "php.ini"

ii. Add the extension to php.ini:

echo "extension = /usr/local/lib/php/extensions/no-debug-non-zts-20160303/memcached.so" >> /path/to/your/php.ini

iii. Restart the web server:

/etc/init.d/httpd restart

5. Verify the Installation:

i. Check if the Memcached extension is loaded:

php -m | grep memcached

ii. Test Memcached using a PHP script or telnet to ensure it works.

This steps ensures that Memcached is properly set up and integrated with PHP in DirectAdmin, improving the server’s performance.

Benefits of Using Memcached in DirectAdmin

We’ll be having the following benefits for using Memcached in DirectAdmin:

  • Enhanced Performance: Memcached reduces database queries and server load, enhancing response times and accelerating dynamic online applications.
  • Improved Scalability: Memcached’s distributed architecture makes it simple to scale up and down in response to spikes in traffic without sacrificing performance.
  • Decreased Database Load: By storing frequently requested data, Memcached lowers database queries while also extending the life of database servers and saving maintenance expenses.
  • Improved Resource Utilization: Memcached ensures effective system resource use by reallocating memory to regions of greater need. This improves memory consumption.
  • Support for Multiple Languages: Memcached makes it easier to integrate into a variety of applications and contexts by offering APIs for the majority of widely used programming languages.

[Want to learn more? Reach out to us if you have any further questions.]

Conclusion

Memcached is a powerful caching tool that enhances web application performance by reducing database load and improving response times. Enabling Memcached in DirectAdmin is straightforward and can significantly boost our server’s efficiency, scalability, and resource utilization.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF