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?
10T |
* Tim Gebhardt <tim@gebhardtcomputing.com> |
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/ |
013 |
* The memcached website: |
014 |
* http://www.danga.com/memcached/ |
016 |
* This module is Copyright (c) Tim Gebhardt. |
017 |
* All rights reserved. |
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 |
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 |
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 |
035 |
* @author Tim gebhardt<tim@gebhardtcomputing.com> |
13Y |
Namespace Memcached.memcachedbench |
041 |
Using System.Collections; |
043 |
Using Memcached.clientlibrary; |
045 |
public class Memcachedbench |
049 |
Arg[0] = The number of runs to do |
050 |
ARG[1] = The run at which to start benchmarking |
052 |
<param name= "args" ></param> |
054 |
public static void Main (string[] args) |
058 |
if (args. Length > 1) |