couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dias, Cliff, VF-Group" <Cliff.D...@vodafone.com>
Subject Emfile error
Date Fri, 26 Aug 2011 14:17:20 GMT
Hi,
I am trying to run a load test on a couch db instance. I am peforming an
http post to insert the data to the DB, but I get an emfile error.

I have read the FAQ and I understand that I have to increase the file
descriptor limit.

I would like to understand why I need to do this ? I am writing to a
single database, so I would expect couch DB to recycle the connection.

Here is the method I use to write. It is a simple method called 10000
times.


public void doAdd(Data data) throws HttpException, IOException
	{
		PostMethod method;
		
		HttpClient client = new HttpClient();
		
		String url = baseURL;
		
		method = new PostMethod(url);


		
		
		Gson gson = new
GsonBuilder().setPrettyPrinting().create();

		
		String jsonOutput = gson.toJson(data);
		
		method.setRequestBody(jsonOutput);
		method.setRequestHeader( "content-type",
"application/json");
		
		long t1 = System.currentTimeMillis();
		
		client.executeMethod(method);
		
		String response = method.getResponseBodyAsString();
		
		long t2 = System.currentTimeMillis();
		
		System.out.println("response = " + response);
		System.out.println("Time = " + (t2-t1));
		

		method.releaseConnection();

	}


Kind regards,
Cliff

Mime
View raw message