PHP and Memcache Installation Instructions _php Tutorial

Source: Internet
Author: User
Recent website traffic, the number of database connections has been high, the analysis of the next, are normal requests, just the site function points of the fine, a single page database query sentence is more, a lot of data is not necessary real-time query, cache up can! Consider the need to use memcache cache, to relieve the pressure of MySQL!

Project name: Weather forecast 15 days query website http://15tianqi.cn

Problem reason: Too many MySQL connection requests, the database pressure is large

Solution: Install enable Memcache cache

What is Memcache? Memcache is a free and open source, high performance, allocated memory object caching system. Used to accelerate dynamic Web applications and reduce database load.

It can handle any number of connections, using non-blocking network IO. Because it works by opening up a space in memory, it then builds a hashtable,memcached self-managing these hashtable. The memcached is simple and powerful. Its simple design facilitates rapid deployment, easy development of the problems faced, and solves many large data caches. Its API is available for the most popular languages.

Anyway, we're going to use memcache this memory cache, we have to install the memcache into PHP, and then install memecached on the Linux system. In this way, PHP can access the data through Memecache memory.

1, download memcached.

Cd/usr/local/srcwget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz

2, install memcached.

Tar zxvf memcached-1.4.15.tar.gzcd memcached-1.4.15./configure--prefix=/usr/local/memcached--with-libevent=/usr/ Local/libeventmakemake Install

3, start memcached and detect whether the installation work

/usr/local/memcached/bin/memcached-d-M 128-p 11211-u rootps aux | grep memcached

Memcache is a very useful caching technology,Memcache's well-known users are: LiveJournal, Wikipedia, Flickr, Bebo, Twitter, TypePad, YellowBot, Youtube and so on.

http://www.bkjia.com/PHPjc/738501.html www.bkjia.com true http://www.bkjia.com/PHPjc/738501.html techarticle Recent website traffic up, the number of database connections has been high, analysis of the next, are normal requests, just the site function of the fine, single-page database query sentence more, a lot of data is ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.