I'm just beginning to mess around with BookSleeve (and redis) on Windows and just wanted to see if I could get some direction on what I may be doing wrong here. Using the following code, and then running ab against it, I can serve ~500 requests before w3wsvc.exe crashes. When I attach to the process to debug I see that the request to the redis server is timing out.
@using (var conn = new BookSleeve.RedisConnection("localhost"))
{
conn.Open();
var catgrabber = conn.ListRange(0,"categories",0,-1);
byte[][] categories = conn.Wait(catgrabber);
foreach (byte[] category in categories)
{
<h3> @System.Text.UTF8Encoding.UTF8.GetString(category) </h3>
var actgrabber = conn.ListRange(0, String.Format("activity:{0}",
System.Text.UTF8Encoding.UTF8.GetString(category).Replace(' ', '_')), 0, - 1);
byte[][] activities = conn.Wait(actgrabber);
foreach (byte[] activity in activities)
{
<label for="@System.Text.UTF8Encoding.UTF8.GetString(category).Replace(' ', '_'):@System.Text.UTF8Encoding.UTF8.GetString(activity):12345">
<input type="checkbox" id="@System.Text.UTF8Encoding.UTF8.GetString(category).Replace(' ', '_'):@System.Text.UTF8Encoding.UTF8.GetString(activity):12345" value="@System.Text.UTF8Encoding.UTF8.GetString(activity)"/>
@System.Text.UTF8Encoding.UTF8.GetString(activity)
</label><br />
}
}
}
I have not yet installed the .NET async/await CTP.
Now, for just a a single webpage hit this works great. I just wanted to bang on the server hosting this so I did ...
ab -n 1000 -c 5 http://server/page.cshtml
It'll serve the 500-700 requests and then crash. While I am not sure I'll ever have this kind of load, I believe that this indicates a glaring flaw in my code and would like to have someone smarter than I point out what I'm doing wrong.
Thanks!