[Mono-dev] stressing mono and xsp

Hugo Ribeiro hribeiro at janeladigital.com
Mon Mar 22 12:34:33 EDT 2010


Been testing xsp with 500 simultaneous users per second and found out two 
issues in code. Also had been getting some annoying exceptions.

-Connection.cs (i sink the disposed exception, because sometimes the socket is 
closed on endrequest right away)

	while (!stop && (UnfinishedRequests || keep_alive));
				
	if (requests.Count == 0) {
		try
		{
			socket.Close ();
			server.EndConnection (this);
			server.ReleaseBuffers (receive_buffer, send_buffer);
		}
		catch (System.ObjectDisposedException) 
		{
			//do nothing, already disposed on endrequest
		}
	}

-Server.cs (on RequestCount property)
		/*
		foreach (Connection c in connections)
			requests += c.RequestCount;
		*/
		for(int i=0;i<connections.Count;i++)
		{
			requests += ((Connection)connections[i]).RequestCount;
		}
		return requests;

The first aproach i didnt like it very much, is a pain to sink an exception. 
We should only make the close on one place.

The second change i didnt have more the exception that the collection had 
change, but isnt thread safe also. It resolve the problem because i think it 
was on the add and not on the remove.

A curious fact was that with the second change the pages started to be 
processed 30% faster.

Are these good changes to apply or should we make the changes another way?

Regards,
Ribeiro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20100322/e410ff14/attachment.html 


More information about the Mono-devel-list mailing list