<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jayway Team Blog &#187; windows</title>
	<atom:link href="http://blog.jayway.com/tag/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jayway.com</link>
	<description>Sharing Experience</description>
	<lastBuildDate>Sat, 11 Feb 2012 10:33:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Using WinDbg to inspect native dump files</title>
		<link>http://blog.jayway.com/2011/05/10/using-windbg-to-inspect-native-dump-files/</link>
		<comments>http://blog.jayway.com/2011/05/10/using-windbg-to-inspect-native-dump-files/#comments</comments>
		<pubDate>Tue, 10 May 2011 05:28:37 +0000</pubDate>
		<dc:creator>Björn Carlsson</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=7977</guid>
		<description><![CDATA[Just a very short instruction on how to inspect native dump files with WinDbg: Get and install and then start WinDbg File - Open Crash Dump ~*kb Lists all the threads and their call stacks. !locks Will show you the critical sections. LockCount - RecursionCount - 1 = the amount of times the lock has [...]]]></description>
			<content:encoded><![CDATA[<p>Just a very short instruction on how to inspect native dump files with WinDbg:</p>
<ol>
<li><a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank">Get and install and then start WinDbg</a></li>
<li>File - Open Crash Dump</li>
<li>~*kb<br />
Lists all the threads and their call stacks.</li>
<li>!locks<br />
Will show you the critical sections. LockCount - RecursionCount - 1 = the amount of times the lock has been acquired.<br />
So if you have several locks that are taken you can check the call stacks and see where you have the deadlock.</li>
<li>!runaway<br />
Will show you time spent in each thread.</li>
</ol>
<p>I find it useful to get a text dump of all the call stacks which I can search in my text editor, rather than clicking around using Visual studio when searching for a deadlock.</p>
<p>And sometimes !locks even saves me the search.</p>
<p>But if I want to inspect variables I load the dump into visual studio.</p>
<p>Common WinDbg commands <a href="http://windbg.info/doc/1-common-cmds.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2011/05/10/using-windbg-to-inspect-native-dump-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with managed dump files using WinDbg</title>
		<link>http://blog.jayway.com/2011/04/26/getting-started-with-managed-dump-files-using-windbg/</link>
		<comments>http://blog.jayway.com/2011/04/26/getting-started-with-managed-dump-files-using-windbg/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 13:10:19 +0000</pubDate>
		<dc:creator>Björn Carlsson</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=7976</guid>
		<description><![CDATA[Why If you have an application built on pre .NET 4.0, you can’t use Visual studio to debug a dump file. Even if you can use Visual Studio, WinDbg offers a nice alternative and some extra features in some scenarios. For example help finding deadlocks and a faster way to scan a lot of threads. [...]]]></description>
			<content:encoded><![CDATA[<h2>Why</h2>
<p>If you have an application built on pre .NET 4.0, you can’t use Visual studio to debug a dump file. Even if you can use Visual Studio, WinDbg offers a nice alternative and some extra features in some scenarios. For example help finding deadlocks and a faster way to scan a lot of threads.</p>
<h2>Getting started with managed (.NET) debugging using WinDbg. Just follow these steps:</h2>
<ol>
<li><a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank">Get and install and then start WinDbg</a></li>
<li>Open Crash Dump</li>
<li>.loadby sos mscorwks Loads the .NET extension</li>
<li>!clrstack Shows the stack of the current thread or use ~* e !clrstack for stacks for all threads</li>
<li>!threads shows a list of the managed threads</li>
<li>~19 s selects thread 19</li>
<li>!dso dump all objects on the stack</li>
<li>!do dump object</li>
<li>!da dump array</li>
</ol>
<h3>Example:</h3>
<p>If I open a crash dump and run:</p>
<ul>
<li>.loadby sos mscorwks</li>
<li>!clrstack</li>
</ul>
<p>in my case I see a stack that ends (or begins) with System.Net.Sockets.Socket.Receive or something else that tells me that it is a request thread and in the application I work with, such a call is associated a Simple.Communication.Path.  Then I run</p>
<ul>
<li>!dso (shows all objects on the stack)</li>
</ul>
<p>and in the output I search for Simple.Communication.Path I find a Path object on the stack with address 22fd77b4. I hope this is the path requested.  to show the value I run:</p>
<ul>
<li>!do 22fd77b4 in the response I find 22fd77ec systemAbsolutePath so I run:</li>
<li>!do 22fd77ec it shows (among other things): String: /Top/Servers/AS5/Trend Quantities/Internal Logs/Interval Trend Log 10_copy_7 So there I have my path.</li>
</ul>
<h2>Make it easier</h2>
<p>To make it easier, download the <a href="http://www.stevestechspot.com/default.aspx" target="_blank">SOSEX</a> extension and copy it into your windbg program folder (WinDbg is also xcopy deployable)</p>
<ul>
<li>.load sosex Loads the sosex extensions</li>
<li>!mk –a Lists the current thread with locals and parameters.</li>
</ul>
<p>You will find the path from above formatted as a string ready to read as an argument to one of the methods on the stack.  Find out more about <a href="http://www.stevestechspot.com/">SOSEX here</a>.  Another SOSEX favorite:</p>
<ul>
<li>!dlk shows deadlocks</li>
</ul>
<p>to find out more about for example investigating memory leaks look in the readme.txt that comes with SOSEX.</p>
<h2>Another extension</h2>
<p>I just recently found out about a new extension <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5c068e9f-ebfe-48a5-8b2f-0ad6ab454ad4" target="_blank">Psscor2 from Microsoft</a>. Download it, put it in your WinDbg directory and load it:</p>
<ul>
<li>.load psscor2</li>
<li>!help</li>
</ul>
<p>And play around. Have fun.</p>
<h2>More Information</h2>
<p>Here you can find the basic commands needed: <a href="http://geekswithblogs.net/.netonmymind/archive/2006/03/14/72262.aspx" target="_blank">SOS Cheat Sheet</a> If WinDbg doesn’t find the symbols, look here: <a href="http://www.osronline.com/article.cfm?article=221" target="_blank">Resolving symbol problems in WinDbg</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2011/04/26/getting-started-with-managed-dump-files-using-windbg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to debug a short hang</title>
		<link>http://blog.jayway.com/2011/04/14/how-to-debug-a-short-hang/</link>
		<comments>http://blog.jayway.com/2011/04/14/how-to-debug-a-short-hang/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 13:23:34 +0000</pubDate>
		<dc:creator>Björn Carlsson</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=7975</guid>
		<description><![CDATA[What can I do? When Bob the tester comes, and tells me that the client application sometimes hangs for about 30 seconds, when Bob is doing nothing. This client, and a hand full of other clients are connected to a system of connected servers. The problem could be a busy server or some internal client [...]]]></description>
			<content:encoded><![CDATA[<h2>What can I do?</h2>
<p>When Bob the tester comes, and tells me that the client application sometimes hangs for about 30 seconds, when Bob is doing nothing. This client, and a hand full of other clients are connected to a system of connected servers. The problem could be a busy server or some internal client problem. We have to find out what the client is doing when it get’s busy, for no good reason.</p>
<p>My first idea was that perhaps Bob could use the feature in the task manager in Vista and Windows 7, right click on a process and select Create Dump File.</p>
<h2>Automate it?</h2>
<p>It would of course be better if we could automate it, it’s not that easy to select a process, right click and choose the right item within 30 seconds.</p>
<p>So then I found a good tool for generating dump files when a windows application is none responsive.</p>
<p>The tool is <a href="http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx">ProcDump</a> from SysInternals.</p>
<p>ProcDump is a command-line utility whose primary purpose is monitoring an application for CPU spikes and generating crash dumps during a spike that an administrator or developer can use to determine the cause of the spike. ProcDump also includes hung window monitoring (<strong>using the same definition of a window hang that Windows and Task Manager use</strong>), unhandled exception monitoring and can generate dumps based on the values of system performance counters.</p>
<p>I have used it to catch the cases where TheClient hangs for a number of seconds.</p>
<p>To use it in this case:</p>
<ol>
<li>Start TheClient</li>
<li>Run ProcDump with the following command line:</li>
</ol>
<p>"procdump.exe -h -ma TheClient.exe TheClient.hang.dmp"</p>
<p>It will then generate a dump file in the current directory when the application shows as "Not responding". Then it’s just to bring out WinDbg to find out what was going on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2011/04/14/how-to-debug-a-short-hang/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Effective and Infinite storage in the cloud session at TechDays 2010 Sweden</title>
		<link>http://blog.jayway.com/2010/04/06/effective-and-infinite-storage-in-the-cloud-session-at-techdays-2010-sweden/</link>
		<comments>http://blog.jayway.com/2010/04/06/effective-and-infinite-storage-in-the-cloud-session-at-techdays-2010-sweden/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 20:06:59 +0000</pubDate>
		<dc:creator>Magnus Mårtensson</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql azure]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows azure]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/2010/04/06/effective-and-infinite-storage-in-the-cloud-session-at-techdays-2010-sweden/</guid>
		<description><![CDATA[The main points of our Effective and Infinite Storage in the Cloud session at TechDays 2010 in Sweden are listed below as well as links to all of our related material and the zip with our demos. The slides are here too but they are in Swedish only. Our session at TechDays 2010 gave an [...]]]></description>
			<content:encoded><![CDATA[<p>The main points of our Effective and Infinite Storage in the Cloud session at <a href="http://microsoft.se/techdays">TechDays 2010 in Sweden</a> are listed below as well as links to all of our related material and the zip with our demos. The slides are here too but they are in Swedish only.</p>
<p>Our session at TechDays 2010 gave an overview of what storage in the Cloud is, according to Microsoft at present date, and some of the goals for the future in this area. We intended our session to provide the basis for companies to be able to evaluate if and how moving storage to the Cloud can enhance their business for their own specific scenarios.</p>
<p>Speaking about Cloud storage and Microsoft today means you need to give a session divided into two parts; <a href="http://www.microsoft.com/windowsazure/sqlazure/">SQL Azure</a> and <a href="http://www.microsoft.com/windowsazure/windowsazure/">Windows Azure storage</a>. And so our presentation had two distinct parts.</p>
<p>As consultants working with different clients we see that companies in general are not yet ready to adopt Cloud storage on a broad scale. However we also see a continuous increase in interest in this area and we believe that this is directly related to the richness of the offerings and services now becoming available. The story matures in the Microsoft camp and the pace is rapid. Cloud storage from Microsoft is admittedly still very young. (Youngest in the business?) But now Microsoft has thrown the full weight of the company behind making the cloud story stick. Expect to see a lot of new offerings, services, products, frameworks etc. in the Cloud coming out from Microsoft in the near future.</p>
<p>There are a few common concerns when it comes to storing data in the cloud. A quick (and perhaps not complete) listing follows:</p>
<h3>Storage cost in the Cloud</h3>
<p>One big concern we hear from clients and in the buzz at conferences that take place around now is a concern related to the cost of storage and data transfer in the Cloud. This is naturally an equally important issue regardless in what Cloud you choose to store your data.</p>
<p>The thing about storing your data in the Cloud is that the cost for this storage is a lot more self evident compared to storing your data in your own servers on premise. This is because you receive a bill each month stating exactly what you have spent for storage in the passed period. What we tend to mitigate is that storage, backups, crash plans and managing all of this on premise, or even hosted, does not exactly come for free either. The big question then becomes what difference in cost there will be for your company for storing and transferring data to a Cloud compared to local hardware operated by your local IT department.</p>
<p>Another aspect of the cost for storage in general is the question of how you build your apps. We believe that many have been a bit oblivious to this issue when they have run their apps and stored our data only on premise or with traditional hosting. Perhaps we have been cost inefficient in this area until now? In the age of Soft Deletes - deleting data does not remove it but rather marks it as deleted – no data is ever actually deleted - managing costs for storing data will become a more and more important question for everyone. Building Cloud applications and storing data in the Cloud has to be done with data storing and management costs in mind. As we hinted to above; the same should have been true for all of your applications up until now. Storing data in the Cloud just makes this point more obvious.</p>
<h3>Storage Security when your data in the Cloud</h3>
<p>Perhaps the fist fear when it comes to storing data in the Cloud is the fear of security breeches and the perceived loss of control of this security. Your data is no longer at home.</p>
<p>What you need to ask yourself, and here we choose to quote a good colleague Sergio Molero <a href="http://twitter.com/sergio_molero">@sergio_molero</a>, is; “What sense of security do you have today? What security is it that you think you will loose when storing your data in the Cloud?”</p>
<p>The same exact thing can be said for hosted data as compared to data stored in the Cloud because the two concepts are very much the same thing in this regard. Data in the Cloud is also hosted data!</p>
<p>One important thing to also keep in mind is that moving to a data storage solution in the Cloud does not mean all of your data must move “out there” somewhere. It is still quite possible to store the most sensitive data on premise and use Cloud storage for more public data only. We believe that the higher focus on security for data in the Cloud will put higher focus on your security efforts compared to your present security on premise. The move to the Cloud could in conclusion prove to heighten the overall security level for your data.</p>
<p>Also look into <a href="http://msdn.microsoft.com/en-us/security/aa570351.aspx">Windows Identity Foundation (WIF)</a> for insights on how to secure your data in the Cloud.</p>
<h3>Trusting someone else with your data in the Cloud</h3>
<p>If security from external attacks to your data in the Cloud is a concern you feel somewhat confident you will be able to handle then perhaps trusting someone else with storing your company sensitive data is a concern that causes you to think twice? Trust is a complex issue not to be taken lightly. We will only raise the concern here and not delve too deep into it.</p>
<p>Can you trust a hosted data storage provider today? If you can, then this is no difference compared to trusting data stored in the Cloud.</p>
<p>If you can’t trust anyone else with your data, then the Cloud is not an option for you. Clean and simple.</p>
<h3>Legal ramifications for storing data in the Cloud</h3>
<p>It feels important to also comment briefly on the potential legal ramifications for storing your data in a Cloud in another country somewhere. That being said we’d just like to point out that we are no lawyers. Let’s be clear on that.</p>
<p>Some data cannot legally be moved outside the borders of your own country. Hospital patient information is a good example of this. Other data must for legal reasons stay within your geo-region, say for instance the EU.</p>
<p>As we hinted to above; not all of your data has this limiting concern. You do have more public data as well as more private data in your business. Only the latter is a potential legal problem. There will be more hybrid solutions for data Storage in the future. Some data for a company will be stored in the Clouds and other data will be stored on premise.</p>
<p>But how can we store data both on premise and in the Cloud without having two separate data storage solutions? One thing that will assist in this endeavor is the rumored upcoming availability of local on-premise, or hosted, Clouds that will be possible to install locally and behave in the same way the big Clouds out there on the Internet do. Right now there does not exist many offerings of this nature. There will in time when companies start to demand them. In fact, given that the storage Clouds today has a REST interface, it is not very difficult to implement that same interface on your own on premise machines! Doing this however will require a good effort on your part and you will end up with a proprietary solution that you will have to evolve over time as the real Clouds shift. Another option is to wait a bit and let the Cloud vendors come up with packaged solutions that you may install simply install in your own data centers. The hybrid solutions that will result from this will play an important role in shaping the solutions for data storage for the coming decade.</p>
<h3>SQL Azure</h3>
<p>In our SQL Azure part of our talk we pointed out three pros and three cons for attendees to take away from our session.</p>
<ol>
<li>Because Windows Azure takes care of all of the maintenance normally associated with a SQL Server server developers are now allowed to <strong>focus on the database</strong> rather than performing administrative tasks.</li>
<li>The database is always available in the sense that upgrades are seamless as well as failover, backup and crash plan which means that the SQL Azure database is <strong>always available</strong>.</li>
<li>The <strong>scaling </strong>story is very strong in SQL Azure. If you can shard your database into many pieces you can scale out from one database to many (say 100) databases to meet a peek load and then back down again to just one at will. For now there is no built in support for this in SQL Azure but this will likely be a story further down the road and you can build it your self today.</li>
</ol>
<p>There are some things to consider when looking into deploying to SQL Azure.</p>
<ol>
<li><strong>Security is locked down </strong>compared to SQL Server. The sys-tables are not yet available for instance. This is because your databases are co-located on the same servers as data belonging to some one else.</li>
<li><strong>Your data is no longer at home</strong> in the sense that it is moved outside your company and even outside your country.</li>
<li>The size right now for one database in SQL Azure is 10 GB but this will increase to 50 GB in June.</li>
</ol>
<h3>Windows Azure Storage</h3>
<p>With Windows Azure Storage Microsoft addresses a set of data storage stories that do not really fit well into a standard relational database structure.</p>
<ol>
<li>There is a powerful and “infinite” message queuing system that enables messaging between the different machines in your applications. This queuing system does not guarantee 100% ordering of the messages in the queue. This is in case of more than one machine working on the same queue. However the queues require dequeue (GET) and delete (DELETE) in order to complete an actual removal of a message. This method will ensure each message will actually be handled in full in case of some error when decueing and handling the message the first time.</li>
<li>There is also a concept in Windows Azure of that which is known as a “Big Table”. Say you want to store 200 million user data sets for Facebook or why not all the messages ever sent to Twitter. For this you need an “infinite” tabular structure that has no end that you will ever hit.</li>
<li>The third thing you can store in Windwos Azure are two kinds of blobs. 1) A so called Block Blob. A blob that is handled in blocks when uploaded. A block Blob is not really intended to be changed once uploaded. You can exchange blocks in the blob but that is not the intent. This is typically a video file or a picture or something that is rarely if ever changed. You would use block blobs to build the next youtube where you can stream files down into a player. 2) A Page Blob. This kind of blob is divided into pages rather than blocks. You can real or write pages at will into this kind of blob. This means that you are able to create a Virtual HardDrive (VHD) and upload it as a page blob to Windows Azure. Then you can actually mount this blob to one or more virtual machines in Windows Azure as an extra hard drive. This comes in handy when moving an application to Windows Azure that uses a lot of disk. All of your old File.Open will continue to work.</li>
</ol>
<p>When considering Windows Azure for your storage think about:</p>
<ol>
<li>You should use only the parts of Windows Azure that you really need. If you need to store backup blob type of data – use only that. There is a good advantage to consider when you have applications to run that will use Windows Azure Storage. If you deploy your application to Windows Azure as well as the data to <em>the same</em> datacenter then the internal data transfer costs between this application and storage is without cost. If you instead run your apps on premise and store data in the cloud the transfer of data to and from the cloud carries a cost.</li>
<li>Regarding the cost you should really make a data storage estimate and analysis before you start up deploying. Your application should have a plan for the amount of data stored, transferred and the duration of storage. This is true on premise too, as discussed above, and data storage plans and budgets will become a more and more important part of any application for the future.</li>
<li>Windows Azure Storage means learning to use a new API. Perhaps not a dramatic thing but the three storage options also affects the way you build the rest of your application. If you disagree chances are you need to learn more about storing data in the cloud.</li>
</ol>
<h3>Links</h3>
<p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=AA40F3E2-AFC5-484D-B4E9-6A5227E73590&amp;displaylang=en">Windows Azure SDK</a></p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5664019e-6860-4c33-9843-4eb40b297ab6&amp;displaylang=en">Windows Azure Tools for Visual Studio</a></p>
<p><a href="http://www.cerebrata.com/Products/CloudStorageStudio/Default.aspx">Cloud Storage Studio</a> – a SSMS look alike for Windows Azure Storage</p>
<p><a href="http://www.fiddler2.com/fiddler2/">Fiddler2</a> – Web debugging proxy</p>
<p><a href="http://cloudstorageapi.codeplex.com/">CloudStorage.API</a> @ CodePlex</p>
<p><a href="http://azurecontrib.codeplex.com/">Azure Contrib</a> @ CodePlex</p>
<p><a href="http://sqlazuremw.codeplex.com/">SQL Azure Migration Wizard</a></p>
<h3>Downloads</h3>
<p>Ziped version of the demo code in the Windows Azure Queue Storage sample:</p>
<p><a href="http://blog.jayway.com/wordpress/wp-content/uploads/2010/04/AzureStorage1.zip">AzureStorage</a></p>
<p>Slides from the presentation:</p>
<p><a href="http://blog.noop.se/images/blog_noop_se/WindowsLiveWriter/EffectiveandInfinitestorageinthecloudses_CCAA/EffektivOchOandligLagringIMolnet.ppsx">EffektivOchOandligLagringIMolnet.ppsx</a></p>
<p><a href="http://blog.noop.se/images/blog_noop_se/WindowsLiveWriter/EffectiveandInfinitestorageinthecloudses_CCAA/EffektivOchOandligLagringIMolnet.pdf">EffektivOchOandligLagringIMolnet.pdf</a></p>
<p>Slides for the demo attached as a zip above</p>
<p><a href="http://blog.noop.se/images/blog_noop_se/WindowsLiveWriter/EffectiveandInfinitestorageinthecloudses_CCAA/DemoWindowsAzureCloudQueue_1.ppsx">DemoWindowsAzureCloudQueue.ppsx</a></p>
<p><a href="http://blog.noop.se/images/blog_noop_se/WindowsLiveWriter/EffectiveandInfinitestorageinthecloudses_CCAA/DemoWindowsAzureCloudQueue.pdf">DemoWindowsAzureCloudQueue.pdf</a></p>
<h3>Final Words</h3>
<p>We would like to thank Microsoft for arranging TechDays, we had a blast! Thanks to the audience for listening.</p>
<p>Cheers,</p>
<p>Peter von Lochow <a href="http://twitter.com/vonlochow">@vonlochow</a> and Magnus Mårtensson <a href="http://twitter.com/noopman">@noopman</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2010/04/06/effective-and-infinite-storage-in-the-cloud-session-at-techdays-2010-sweden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How-to get a large C: drive for Windows on Amazon</title>
		<link>http://blog.jayway.com/2010/03/31/how-to-get-a-large-c-drive-for-windows-on-amazon/</link>
		<comments>http://blog.jayway.com/2010/03/31/how-to-get-a-large-c-drive-for-windows-on-amazon/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 09:08:11 +0000</pubDate>
		<dc:creator>Adam Skogman</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ebs]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=5238</guid>
		<description><![CDATA[Amazon has excellent Windows support these days. Many time you'd like a larger C: drive than the 30 GB that come standard with the Amazon images. Here is how you enlarge the boot drive to 100 GB.]]></description>
			<content:encoded><![CDATA[<p>Amazon has excellent Windows support these days, and computers boot up from EBS. Drives are therefor both fast and robust. However, many time you'd like a larger C: drive than the 30 GB that come standard with the Amazon images. Here is how you enlarge the boot drive!</p>
<p>First step is to boot an instance. You need the command line tools for this, as neither the AWS Management Web Console nor ElasticFox currently supports this right now (note to developers - please add!).</p>
<pre>
ec2-run-instances --region eu-west-1 \
     -K pk-YOURKEYHERE.pem \
     -C cert-YOURCERTHERE.pem \
     <strong>-b '/dev/sda1=:100' \</strong>
     ami-d7a78ca3 \
     -g my-security-group -g common-security-group \
     -t m1.large \
     -k thekeyhere \
     --disable-api-termination \
     --instance-initiated-shutdown-behavior stop \
     -z eu-west-1a
</pre>
<ul>
<li>The command is <strong>ec2-run-instances</strong> with an <strong>'s'</strong> in the end. There is another command in the API without the s, which doesn't work.</li>
<li><strong>-b</strong> is the most important flag here. It says to make the boot disk (/dev/sda is Linux speek for C:) 100 GB, despite what the AMI manifest says (which is 30 GB).</li>
<li><strong>ami-d7a78ca3</strong> is the Windows image, in this case a 64bit Windows 2008.</li>
<li>-g security-group you should add as many as you like. Remember to think these through, since you cannot change which groups an instance belongs to.</li>
<li>The flags <strong>--disable-api-termination --instance-initiated-shutdown-behavior stop</strong> are really nice, because that make sure you cannot accidentally terminate the instance, making the harddrive disappear.</li>
<li>Note that I'm running in the EU region here.</li>
</ul>
<p>Ok, so now you have a running Windows server. Once it has booted, you log on using remote desktop (well, as soon as you have the generated password, which takes 15 min). PLease note that the C: drive will show up as 30 GB at this point. The partition is still only 30 GB, even if the virtual harddrive is 100 GB.</p>
<ol>
<li>Go into the windows management console. Go to <strong>disk management</strong>.</li>
<li><strong>Right-click</strong> on the C: drive. Choose <strong>Extend volume</strong> from the context menu.</li>
<li>In the wizard that pops up, just accept the defaults, and click finish.</li>
</ol>
<p>Done! The change is instant (no reboot or anything), and your system drive C: is now 100 GB.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2010/03/31/how-to-get-a-large-c-drive-for-windows-on-amazon/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Performance nightmare</title>
		<link>http://blog.jayway.com/2010/03/05/performance-nightmare/</link>
		<comments>http://blog.jayway.com/2010/03/05/performance-nightmare/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 06:52:17 +0000</pubDate>
		<dc:creator>Björn Carlsson</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.jayway.com/?p=4810</guid>
		<description><![CDATA[22 to 0.3 seconds! I found a simple solution to a very common problem. While profiling I found that remove in this little method took a lot of the time. public void MovePropertyFirst(IProperty property) { properties.Remove(property); properties.Insert(0, property); } The reason was, that it's time consuming to compare the properties by equality, for complex types. [...]]]></description>
			<content:encoded><![CDATA[<p>22 to 0.3 seconds!</p>
<p>I found a simple solution to a very common problem. While profiling I found that remove in this little method took a lot of the time.</p>
<pre>   public void MovePropertyFirst(IProperty property)
   {
      properties.Remove(property);
      properties.Insert(0, property);
   }</pre>
<p>The reason was, that it's time consuming to compare the properties by equality, for complex types. I think that in most (?) cases we want to delete the very same instance we supply as parameter to the remove method.</p>
<p>So I implemented a ReferenceEquals based remove, and by that I cut the time spent in remove by about 72 times!</p>
<pre>  public static bool RemoveFrom&lt;T&gt;(this IList&lt;T&gt; list, T itemToRemove)
  {
    if(list.Count == 0)
      return false;
    int index = 0;
    foreach (var item in list)
    {
      if (ReferenceEquals(item, itemToRemove))
      {
        list.RemoveAt(index);
        return true;
      }
      index++;
    }
    Debug.Assert(false, "Item to delete not found");
    //equality based fall back
    return list.Remove(itemToRemove);
  }</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.jayway.com/2010/03/05/performance-nightmare/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

