Memcached installation and testing under Windows

Source: Internet
Author: User
Tags memcached memcached windows memory usage

Memcached is a high-performance distributed memory object caching system for dynamic Web applications to reduce database load. It reduces the number of read databases by caching data and objects in memory, providing the speed of dynamic, database-driven Web sites. Memcached is based on a hashmap that stores key/value pairs. Its daemon (daemon) is written in C, but the client can write in any language and communicate with the daemon through the memcached protocol. However, it does not provide redundancy (for example, copying its hashmap entries), and when a server s stops running or crashes, all key/value pairs placed on s will be lost.

Memcached official: http://danga.com/memcached/

For memcached Introduction Please refer to: memcached depth analysis

Download the server side of Windows

Download Address: http://code.jellycan.com/memcached/

Installing Memcache Server (You can also not install the direct boot)

1. Download the memcached Windows stable version, extract and put under a certain disk, such as in c:\memcached
2. Enter the "c:\memcached\memcached.exe-d Install" installation under CMD.
3. Re-enter: "C:\memcached\memcached.exe-d start" start. Note: Later memcached will start automatically every time a service is powered on as windows. This way the server side is already installed.

If you download a binary version, run directly on it, you can add parameters to set.


Common settings:
-P <num> Listening ports
-L <ip_addr> connected IP address, default is native
-D Start memcached service
-D Restart Restart memcached service
-D Stop|shutdown shut down the running memcached service
-D Install installation memcached service
-d Uninstall Uninstall memcached service
-U <username> Run as <username> (valid only when run as root)
-M <num> maximum memory usage, in MB. Default 64MB
-Returns an error when M memory is exhausted instead of deleting the item
-C <num> Maximum simultaneous connection number, default is 1024
-F <factor> block size growth factor, default is 1.25
-N <bytes> min Allocate space, key+value+flags default is 48
-H Display Help

Then you can try it with the. NET memcached client.

APIs available under C # (with detailed descriptions and comments in each client API)

https://sourceforge.net/projects/memcacheddotnet/
http://www.codeplex.com/EnyimMemcached/-Client developed in. NET 2.0 keeping performance and extensibility in

Mind. (Supports consistent hashing.)
Http://code.google.com/p/beitmemcached/-Client developed by BeIT and many new features

Reprint Source: http://www.yaosansi.com/

----------------------------------------------------------------------------------------

Client invocation:

Download sample code URL: http://sourceforge.net/projects/memcacheddotnet/

C#/.net memcached Client library. This library can is used by the. NET projects to access memcached servers. Ported from the Java memcached library located athttp://www.whalin.com/memcached/.

e.g.: View source print?

001 /**
002 * MemcachedBench.cs
003 *
004 * Copyright (c) 2005
10T * Tim Gebhardt <tim@gebhardtcomputing.com>
006 *
007 * Based off of the code written by
008 * Greg Whalin <greg@meetup.com>
009 * For his Java Memcached client:
010 * http://www.whalin.com/memcached/
011 *
012 *
013 * The memcached website:
014 * http://www.danga.com/memcached/
015 *
016 * This module is Copyright (c) Tim Gebhardt.
017 * All rights reserved.
018 *
019 * This library are free software; You can redistribute it and/or
020 * Modify it under the terms of the GNU lesser General public
021 * License as published by the free Software Foundation; Either
022 * Version 2.1 of the License, or (at your option) any later
023 * Version.
024 *
025 * This library are distributed in the hope that it'll be
026 * useful, but without any WARRANTY; Without even the implied
12V * Warranty of merchantability or FITNESS for A particular
028 * Purpose. The GNU Lesser general public License
029 * Details.
030 *
031 * Should have received a copy of the GNU Lesser General public
032 * License along with the This library; If not, write to the free Software
033 * Foundation, Inc., Temple Place, Suite, Boston, MA 02111-1307 USA
034 *
035 * @author Tim gebhardt<tim@gebhardtcomputing.com>
036 * @version 1.0
037 */
13Y Namespace Memcached.memcachedbench
039 {
040 Using System;
041 Using System.Collections;
042
043 Using Memcached.clientlibrary;
044
045 public class Memcachedbench
14W {
047 <summary>
048 Arguments:
049 Arg[0] = The number of runs to do
050 ARG[1] = The run at which to start benchmarking
051 </summary>
052 <param name= "args" ></param>
053 [STAThread]
054 public static void Main (string[] args)
055 {
056 int runs = 100;
15V int start = 200;
058 if (args. Length > 1)
059

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.