doing my first steps with memcached (C# interface)

Roni Schuetz schuetz at gmail.com
Mon Jan 8 18:58:11 UTC 2007


hi all,

any help and / or info is very appreciated but I think you aggree with me
that something is running wrong here.

i have some trouble to get started. everybody is talking about millions of
objects here but when i'm running a loop with around 10000 objects i get the
following results.

[i'm running this on my XP client.]

10000 gets: 00:00:07.4687978ms
*Cache hits: 720
Cache misses: 9280*
192.168.212.21:11211
time:1168282144
total_items:10000
connection_structures:5
version:1.2.1
limit_maxbytes:67108864
cmd_get:10000
bytes_written:23744040
total_connections:5
bytes:23633480
get_misses:9280
pointer_size:32
uptime:132
curr_connections:4
pid:41848
bytes_read:328138807
get_hits:720
cmd_set:10000
curr_items:720

i'm starting the memcached like that:

*memcached.exe -d start -m 2048 -l 192.168.212.21 -p 11211*

here are some extracted code from my adapted benchmark code:


for(int i = start; i < start+runs; i++)

{

XPath x = new XPath();

x.Text = x.Child1.Text = x.Child2.Text = obj;

x.Sum = x.Child1.Sum = x.Child2.Sum = 5;

x.SumLong = x.Child1.SumLong = x.Child2.SumLong = DateTime.Now.Ticks;

mc.Set(keyBase + i, x);

}
// some additional code


for(int i = start; i < start+runs; i++)

{

XPath s = (XPath) mc.Get(keyBase +i.ToString());

// string str = (string) mc.Get(keyBase + i);

if (s != null)

{

++hits;

s.TestMethod();

}

else

++misses;

}

.... etc.

*and this is like my sample class looks like (xpathchild 1 + 2 are quite the
same)*

[Serializable]

public class XPath

{

public XPath()

{

this.child1 = new XPathChild1();

this.child2 = new XPathChild2();

for(int i=0; i < 500;++i)

{

list1.Add(new XPathChild1());

list2.Add(new XPathChild2());

}

}

public List<XPathChild1> list1 = new List<XPathChild1>();

public List<XPathChild2> list2 = new List<XPathChild2>();

#region Property: Child1

private XPathChild1 child1;

/// <summary>

/// Gets/sets the Child1

/// </summary>

public XPathChild1 Child1

{

[System.Diagnostics.DebuggerStepThrough]

get { return this.child1; }

[System.Diagnostics.DebuggerStepThrough]

set { this.child1 = value; }

}

#endregion

#region Property: Child2

private XPathChild2 child2;

/// <summary>

/// Gets/sets the Child2

/// </summary>

public XPathChild2 Child2

{

[System.Diagnostics.DebuggerStepThrough]

get { return this.child2; }

[System.Diagnostics.DebuggerStepThrough]

set { this.child2 = value; }

}

#endregion

#region Property: Text

private string text;

/// <summary>

/// Gets/sets the Text

/// </summary>

public string Text

{

[System.Diagnostics.DebuggerStepThrough]

get { return this.text; }

[System.Diagnostics.DebuggerStepThrough]

set { this.text = value; }

}

#endregion

#region Property: Sum

private int sum;

/// <summary>

/// Gets/sets the Sum

/// </summary>

public int Sum

{

[System.Diagnostics.DebuggerStepThrough]

get { return this.sum; }

[System.Diagnostics.DebuggerStepThrough]

set { this.sum = value; }

}

#endregion

#region Property: SumLong

private long sumLong;

/// <summary>

/// Gets/sets the SumLong

/// </summary>

public long SumLong

{

[System.Diagnostics.DebuggerStepThrough]

get { return this.sumLong; }

[System.Diagnostics.DebuggerStepThrough]

set { this.sumLong = value; }

}

#endregion

public void TestMethod()

{

Console.WriteLine(@"Text: " + this.Text);

Console.WriteLine(@"Sum: " + this.Sum.ToString());

Console.WriteLine(@"SumLong: " + this.SumLong.ToString());

Console.WriteLine(@"Child1.GetHashCode: " + this
.Child1.GetHashCode().ToString());

Console.WriteLine(@"list1.Count: " + this.list1.Count.ToString());

Console.WriteLine(@"Child2.GetHashCode: " + this
.Child2.GetHashCode().ToString());

Console.WriteLine(@"list2.Count: " + this.list2.Count.ToString());

Console.WriteLine(@"*****************************************");

}

}

-- 
Kind regards,
Roni Schuetz

do you search flights - http://www.indeXus.Net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.danga.com/pipermail/memcached/attachments/20070108/d10267d9/attachment.html


More information about the memcached mailing list