2005-10-26

SQL Server 2000 Analysis Services Performance Tuning

Not really one of my areas of competence, but sometimes one have to try to do one's best. The article describes what one might do to improve performance for a data warehouse using MS OLAP / MS Analysis Services.

2005-10-24

Debugging timeouts in a SOA/Web environment

In a Service Oriented Architecture (SOA), having some webservice methods that consume more than a minutes time, timeout can be a problem.

In this scenario there is also a web site acting as the webservice client. The webservice is getting its data from a database.

We know there is a timeout, but where?
a) Could be the connection to the database from the webservice.
b) Could be the connection between the webservice and the webservice client.
c) Could be a browser timeout.
d) Could be a .NET Framework/ASP.NET timeout.

a. The connection to the database
The timeout of a query can be set by a propery on the ADO.NET Command object. The default is 30 seconds.

OleDbCommand dbcmd = new OleDbCommand();
dbcmd.CommandTimeout = 600; //10 minutes should be enough?

b. The connection to the webservice
The timeout of the http connection of a synchronous call to a web service has a default timeout of 100 seconds. This can be set by a property on the web service proxy. You can set it in the constructor of the webservice proxy (remember that this may me overwritten when you update your webservice reference):

public WSMyWebservice() {
this.Credentials = System.Net.CredentialCache.DefaultCredentials;
this.Url = "http://localhost/webservice/WSMyWebservice.asmx";
this.Timeout = 450000; //wait for 7.5 minutes
}

c. The browser timeout
Not covered in this topic.

d. .Net Framework / ASP.NET timeout
There are a few places the timeout can be set in machine.config.
The executionTimeout in the httpRuntime section can be increased. In the .NET Framework versions 1.0 and 1.1, the default is 90:
<httpruntime
maxrequestlength="4096"
usefullyqualifiedredirecturl="false"
minfreethreads="8"
minlocalrequestfreethreads="4"
apprequestqueuelimit="100"
enableversionheader="true"
executiontimeout="90">

In the processModel section there are several timeouts that can be set:
<processmodel
username="machine"
password="AutoGenerate"
timeout="Infinite"
enable="true"
idletimeout="Infinite"
shutdowntimeout="0:00:05"
requestlimit="Infinite"
requestqueuelimit="5000"
restartqueuelimit="10"
memorylimit="60"
webgarden="false"
cpumask="0xffffffff"
loglevel="Errors"
clientconnectedcheck="0:00:05"
comauthenticationlevel="Connect"
comimpersonationlevel="Impersonate"
responsedeadlockinterval="0:03:00"
maxworkerthreads="20"
maxiothreads="20">

The above should show the default settings, although I can't guaratee it. The setting that may be changed to avoid timeout is the responseDeadlockInterval. MSDN states the following about the setting: Specifies the time interval, in standard process model format (hr:min:sec), after which the process is restarted, if the following conditions are met: 1) There are queued requests, and 2) There has not been a response during this interval.

2005-10-19

Logging with log4net stops when aspnet_wp is recycled

A collegue of mine just discovered this problem. The problem was that logging using log4net stops whenever the aspnet_wp process is recycled. The problem is caused by the way log4net and ASP.NET works.

First, whenever the aspnet_wp process has been idle for a while or has used more memory than it should (over 60% default), the process is recycled. This is done in a clever way so users should not be affected. A new aspnet_wp process is started in parallell with the old one, gradually taking over the workload by serving all new requests.

Second, log4net stops logging, even stops trying to log, as soon as it finds out that it can't write to the logfile. Essentially logging is then disabled.

These two facts together is causing logging to stop. When the second aspnet_wp process is started, it will try to log to the same file that the old aspnet_wp process is already logging to. The file will be locked by the old process, so log4net in the new process will detect that the file is not writeable, and disable logging.

2005-10-12

Well... now you can play World of Warcraft even when you sleep. Somebody had made a bot that plays for you and earns experience points even when you sleep... Cheating?

WELCOME TO WEALTHQ.COM!
How big is Visual Studio?

"Visual Studio is over 43 million lines of code, there are over 30 teams working on different pieces, with roughly 700 developers checking-in code to 11 different virtual build labs that are then integrated on a rotating schedule producing over 100 different builds of the product daily."

Mike Stall's .NET Debugging Blog : Size of Visual Studio