Category Archives: Microsoft

Caching and Performance With Commerce Server 2007

The starter site that Microsoft provides with the Commerce Server product is a pretty good model to follow, so the basic site functionality was not extremely difficult to produce. However, performance tuning was a very long and painful process.

To begin with we used normal Commerce Server objects to populate an ASP.NET menu control, without any caching at all. Predictably this approach brought the server to its knees as soon as even a light load was placed on it.

Next we tried using the Commerce Server caching objects. When a user visits the page the code would check to see if there was an object for the menu in the chache, and if not then it would hit the Commerce Server objects to pull the information and place it in the cache.

This method looked great at first, and we thought we had the problem solved. The performance was fantastic. But then we started noticing that the menu was dissapearing! It would be fine for a while but would start acting up when the load increased. Performing an IISreset would solve the problem, at least temporarily.

We tried a number of code driven approaches to solve the problem, including adding checks to examine the cache to make sure there were values there. Nothing seemed to work.

Finally someone had a bright idea after reviewing the code again. The cache code we had in place was reading the data, then creating the menu, and then storing the whole menu object in the cache. Instead, we started chaching only the raw data and then building the menu fresh on the page.

Performance was not quite as good as the previous solution, but has almost completely solved the dissapearing menu problem. I have seen the menu dissapear a couple of times since then, but it is very rare.

The only thing I can guess is that someone the cache was getting corrupted and not acting like it should after that. Our servers are in a web farm, so perhaps something gets borked when a user gets switched from one server to the next in the middle of a shopping session.


Microsoft Commerce Server 2007

I’m going to be posting about Microsoft’s Commerce Server 2007. The company that I work for was part of the Microsoft TAP program to beta test the product and we were one of the first companies to launch a production web site on the product.

There are good and bad things about the product so I plan on sharing my rants about things that bug me with it, as well as tips about what I’ve done to get past common problems that I’ve encountered.

If you have questions for me about Commerce Server 2007, or have your own experiences to share, use the contact page to email me.


Open HOSTS file with Notepad in Windows

Have you ever needed to edit your hosts file (and if you don’t know what a hosts file is, this post is not for you) on a Windows machine ? You have probably noticed that because it doesn’t have a file extention, Windows Explorer won’t let you accociate an application with it so you are forced to go through the list and choose notepad every time.

It’s something that I have to do painfully often, and after a while I got tired of having to dig into that deep directory structure to open the file so I made shortcut on my desktop. A few days ago I clicked my link and was prompted to choose the application yet again when it occurred to me that a simple edit to the shortcut would solve the pain for good.

Right click on the shortcut and choose “properties”. In the box that lists the target file, it will say something like “c:\windows\system32\drivers\ect\HOSTS”. All you have to do is pipe that path into Notepad by changing that box to read ‘notepad “c:\windows\system32\drivers\ect\HOSTS”‘. Simple eh? Now it opens quite happily in Notepad and I don’t have to mutter at the screen when it asks me if I want to “search the web” to find an appropriate application with which to open the file.

Enjoy!