Archive

Archive for May, 2009

Manage Application Pool Recycling in IIS7

May 21st, 2009
Comments Off

If you manage a website that is hosted with the latest Windows Server 2008 and IIS7 you probably want to be aware of the Application Pool settings in general, and in particular the Application Pool Recycle settings. As it turns out, by default, Windows Server 2008 sets the Application Pool to recycle every 1740 minutes. Which is exactly 29 hours or one full day and 5 hours or the number of lattes I had in the winter. All kidding aside, this number is a bit random, especially because it determines when the website’s application pool will recycle and the website will need to recompile, recache, etc. Here is a screenshot:

edit_app_pool_recycling_settings_default

Instead, what I recommend is that you uncheck the regular time intervals checkbox and use the Specific time one. I chose here 2:00 AM because it is when the site sees the lowest numbers of hits and it is the best time to handle a recycle. You should setup your webserver to recycle when your site is experiencing the lowest traffic levels. So, you’ll probably need to dig into the analytics a bit. Here is a screenshot of how I setup my server:

edit_app_pool_recycling_settings_recommended

Pros:
- Recycles during off peak hours
- You actually control when it recycles
- Typically a performance boost on average

Cons:
The application will now recycle every 24 hours, instead of 29 hours. In fact, if you are certain that your website has no major problems and no memory leaks you can potentially set the application pool to not recycle automatically at all. This state needs to be monitored but may result in a longer smooth ride. Enjoy!

.NET Framework, Performance Optimization, Web Application Hosting

Avoid editing ‘hosts’ file by using FoxyProxy plugin for FireFox

May 15th, 2009
Comments Off

I love it when small utilities like this make web development so much easier. In my everyday development, I religiously edited the ‘hosts’ file. Yes, that file hidden away in the Windows folder that also requires special Admin security elevation in Vista. I managed to overcome all these items by locating a shortcut on my desktop that would open it in Notepad and be ready for editing. That was great for a while.

foxyproxy_patterns_screenshot

This method had a few downsides to it. When I try to switch between the localhost version of a site and a remote site many times within a short amount of time, the not so many steps that are needed all of a sadden seem a lot. More problematic is the fact that there is no indication as to which state a specific site is set at the moment: localhost or remote? and in some cases I ended up sending a completely broken site to the client who probably thinks I am a rookie with an internet connection. Don’t forget that when you change your hosts file, you also need to either restart the browser or go to the file menu, choose ‘work offline’and then ‘work online’ and refresh the site. None of that is necessary with a simple add-on to FireFox: FoxyProxy.

FoxyProxy acts as a proxy server between the Firefox and the internet. You set a ‘proxy’ which essentially allows you to direct traffic to a single point – I use one that directs traffic to ‘localhost’ – then you can add as many patterns as you want that will be associated with the Proxy. Once all is setup, you can then turn this Proxy on or off with a single right click at the bottom of the browser. For me, the setup is quite simple and it works great.

Ok, so there is one caviat here: sometimes I do need to test the websites in different browsers. In this case, this browser add-on will simply not cut it. But for most of my daily web dev needs – it is great!

Web Development

Cleaning an entire subversion working folder from ‘.svn’ folders

May 12th, 2009

Rarely I need to clean an entire folder from all the hidden ‘.svn’ folders which makes it a working copy of an existing repository. Unfortunately my projects tend to be large in the number of files and fairly complex. When I upgrade the project, say from Ektron 7.0.4 to Ektron 7.65 SP2, there are a lot of changes in the files. In the upgrade process, some folders loose their ‘.svn’ subfolders which makes it difficult to use the ‘SVN Update’ + ‘SVN Commit’ walk in the park method. What we need is a ‘SVN Reintegrate’ option, lets create one.

subversion_svn_reintegrate

Until now, what I end up doing is removing all the ‘.svn’ subfolders, checking out the project to another folder, removing all the files from the checked out folder (SVN Delete), copying over all the current set of files/folders, and checking the whole thing back in to the SVN repository. This works well but it requires some serious file manipulation efforts. Here are two usefull tools I just recently discovered that can help tremendously with this process:

1. Cleaning an entire subversion working folder from ‘.svn’ folders:

Ryan Christensen describes how to remove all .svn subfolders from a SVN working copy. In short, you need to create a small ‘.cmd’ file that will live in the top folder that you want to detach from SVN and write this command in it:

for /f "tokens=* delims=" %%i in ('dir /s /b /a:d *svn') do ( rd /s /q "%%i" )

I saved it as cleansvn.cmd and run it from a command line window after changing the current directory to the project folder. You will need to wait until the TortoiseSVN checks all the subfolders because it keeps a bunch of info in cache and with this util – it doesn’t refresh veru quickly. But it works great.

2. The new Rsync for Windows, called RichCopy:

Apparently, Microsoft has recently (April 2009) published this free utility called RichCopy which comes to replace the RoboCopy GUI tool from 2006. According to the article, this utility is also many times more efficient and handles multi threading, network connections, etc. I tried it and it worked great for me.

Here are the new steps for my ‘SVN Reintegrate’ procedure:

  1. Backup all working copies before proceeding
  2. Clean working copy from all ‘.svn’ folders
  3. Checkout latest project from SVN repository to another folder (not a subfolder)
  4. Use RichCopy to copy over all the files, these are the settings:
    1. Source: the new clean working folder
    2. Destination: the latest SVN checked out folder
    3. Use the ‘Purge’ option
    4. Exclude all ‘.svn’ folders from this process
  5. SVN Commit the SVN folder that was overwritten by the working folder

A bit confusing but if you know what you are doing it can save you a few white hairs. Enjoy!

Ektron, Web Development , ,

Browser Wars: IE Share Dropping while User Base Still Growing

May 5th, 2009
Comments Off

What am I talking about? First you need to look at this graph of browser usage over time since 1996 by Asa Dotzler. Please note that the sources for this graph are not clearly identified but still this makes a strong point of paying attention to the entire picture, not only market share.

Basically, while Internet Explorer’s market share continues to drop drastically and FireFox’s market share continues to increase the rate of new internet users is so vast that the total number of IE users is still increasing. In addition, it is obvious that Microsoft is paying a lot of attention to its browser and packs it with features. Furthermore, it will be the default browser in the highly anticipated Windows 7 new operating system, which is expected to gain significant higher adoption rate than Vista. In short, it is wise not to write IE off and keep the Virtual Machines with the various IE versions handy.

Another observation is the market share that FireFox has commanded and the short amount of time it did so. Remember that users who download FireFox and use it do so because they truley believe it is a superior browser. Unlike other browsers that come bundled with the OS (IE, Safari), or have a deep-pockets corporation behind it (Chrome).

Web Development , ,