Python Memcache and Redis

Source: Internet
Author: User

Installation of 1.memcache

Http://www.cnblogs.com/zgx/archive/2011/08/10/2134097.html

Memcached-d-M 10-u root-l 192.168.15.128-p 12000-c 256-p/tmp/memcached.pid

parameter description:     -D is to start a daemon     -m is the amount of memory allocated to the memcache, in megabytes    -u is the user    running Memcache -L is the server IP address    of the listener -p is the port to set memcache listening, preferably more than    1024 ports -theC option is the maximum number of concurrent connections to run, the default is 1024, According to the load of your server to     set-P is set to save memcache PID file

2. Execute program error in memcache module

A Bytes-like object is required, not ' str '-error

The reasons are:

Python-memchached is isn't supported on Python 3.5 If you ve used python-memchached, the following commands would help you.

Pip Uninstall python-memcached
Pip Install python3-memcached

Example of 3.memcache

Import= memcache. Client (['192.168.15.128:12000'],debug=True) mc.set ("Some_key  "Some value" = Mc.get ("Some_key " )print (ret)
Results:
Some value

Some methods of 4.memcache

Http://www.cnblogs.com/wupeiqi/articles/5132791.html

Python Memcache and Redis

Related Article

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.