Hi ES Friends,
I'm trying to PUT documents into my ElasticSearch index from an ASP.NET
app, and it takes on average three seconds to index one small document! Way
too slow! Can someone tell me what I'm doing wrong?
I am running on Windows 7 for my test environment on a Quad-Core with
Hyperthreading (8 CPU's) 3.33ghz
I have 12 GB of RAM
I am running 64-bit Windows
I am running jdk1.7.0_04 64-bit
ES_HEAP_SIZE: 4g
ES_JAVA_OPTS: -Xms2g -Xmx4g
.NET code (using the samples in the installation docs):
[TestMethod]
public void PutTest()
{
string url = "http://localhost:9200/twitter/user/kimchy"; //
index/type/id
string postData = new JavaScriptSerializer().Serialize(new {
user = "kimchy",
postDate = "2009-11-15T13:12:00",
message = "Trying out Elastic Search, so far so good?"
});
Console.WriteLine("postData is:");
Console.WriteLine(postData);
WebClient client = new WebClient();
//client.Headers.Add("Content-Type",
"application/x-www-form-urlencoded");
Stopwatch sw = new Stopwatch();
sw.Start();
byte[] responseArray = client.UploadData(url, "PUT",
Encoding.ASCII.GetBytes(postData));
sw.Stop();
Console.WriteLine();
Console.WriteLine("Elapsed: {0}", sw.Elapsed);
Console.WriteLine("Response:");
Console.WriteLine(Encoding.ASCII.GetString(responseArray));
}
And last but not least, here is the serialized document that .NET is
posting:
{"user":"kimchy","postDate":"2009-11-15T13:12:00","message":"Trying out
Elastic Search, so far so good?"}
Why is my indexing taking three seconds?!
Cheers,
Allison A.
--