To find out where the performance problem was, we have set up an web application stress testing grid and have put our version of CuteChat under heavy load.
We noticed that CuteChat invokes some of the callback methods defined in SampleProvider.cs, UserData.cs and Global.asax.cs several times per second. Each of those methods makes a SQL query to fetch information about the currently logged user (his/her role, if it is available in the database, etc.). We customized this methods making them point to our database, while the default version points to the CuteChat database.
As the users keep logging on to the application, the number of the SQL queries per second increases, to the point that after 40-50 users (which cause about 160-200 query per second) the Cutechat load balancing server stops responding.
Knowing this, we added a simple caching algorithm in the UserData.cs and Global.Asax.cs methods which make the queries, thus boosting performance under heavy load.
Fabrizio Cipriani