<?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>PowerPivotGeek &#187; Midtier</title>
	<atom:link href="http://powerpivotgeek.com/category/midtier/feed/" rel="self" type="application/rss+xml" />
	<link>http://powerpivotgeek.com</link>
	<description>An adventure in managed self-service computing</description>
	<lastBuildDate>Wed, 14 Jul 2010 04:51:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why is allocation always selecting the same machine?</title>
		<link>http://powerpivotgeek.com/2010/06/14/why-is-allocation-always-selecting-the-same-machine/</link>
		<comments>http://powerpivotgeek.com/2010/06/14/why-is-allocation-always-selecting-the-same-machine/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 21:19:28 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[Midtier]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/06/14/why-is-allocation-always-selecting-the-same-machine/</guid>
		<description><![CDATA[<p>If you are running PowerPivot for SharePoint on more than one backend app server, then it is a common issue that folks are seeing only one server being used. It turns out that this might be ‘by-design’ so let’s talk about it for a bit. Let’s look at the two allocation methods we support:</p>

Round-robin (the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are running PowerPivot for SharePoint on more than one backend app server, then it is a common issue that folks are seeing only one server being used. It turns out that this might be ‘by-design’ so let’s talk about it for a bit. Let’s look at the two allocation methods we support:</p>
<ol>
<li>Round-robin (the default) – This algorithm selects first one app server; then the next; then the next; until it loops back around. Since the actual marker for what is “the next” is kept in the proxy for the PowerPivot service application, the net-effect of this in practice is that the selection looks different from what you would expect. The behavior is a lot closer to random rather than sequential. Being random, and with a low number of servers to pick from (for example, 2), you should naturally expect that one app server might seem to be biased. Add more servers and you will see less bias.</li>
<li>Health-based – This is the one that most large shops will likely choose. The idea behind health-based is that the system will decide which is the ‘best’ app server for a machine. So when the allocation appears bias, it seems like health-based isn’t working. In reality, health-based may be doing exactly what was intended. If all machines have memory available (i.e. none of them are under memory pressure), then health-based uses CPU to break any ties, i.e. which ever CPU has the most CPU free wins. Let’s take an example:Suppose you have two machines “A” and “B”. Both are running PowerPivot. They both have 32GB on them with four quad-core processors. Rather than being dedicated to PowerPivot, “A” also doubles as the backend app server for Excel Services. Likewise, “B” doubles as the backend app server for PerformancePoint Services. So long as Excel Services and PerformancePoint consume similar CPU time, then databases will be loaded back and forth between “A” and “B” as one is more lightly loaded than the other. However, if PerformancePoint is lightly used and “B” is consistently less loaded (CPU-wise), then you will see PowerPivot databases being allocated to “B” until it becomes under memory pressure, and then allocation will shift to “A”.</li>
</ol>
<p>All-in-all, health-based is still the best algorithm for large shops. Remember that the PowerPivot engine is an in-memory system. Our first goal is to get databases allocated wherever memory is available – balancing across the farm is not a priority.</p>
<p>Enjoy.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F06%2F14%2Fwhy-is-allocation-always-selecting-the-same-machine%2F&amp;linkname=Why%20is%20allocation%20always%20selecting%20the%20same%20machine%3F"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/06/14/why-is-allocation-always-selecting-the-same-machine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing the Claims To Windows Token Service for different identities</title>
		<link>http://powerpivotgeek.com/2010/05/21/testing-the-claims-to-windows-token-service-for-different-identities/</link>
		<comments>http://powerpivotgeek.com/2010/05/21/testing-the-claims-to-windows-token-service-for-different-identities/#comments</comments>
		<pubDate>Fri, 21 May 2010 15:54:00 +0000</pubDate>
		<dc:creator>powerpivotwahoo</dc:creator>
				<category><![CDATA[Midtier]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/05/21/testing-the-claims-to-windows-token-service-for-different-identities/</guid>
		<description><![CDATA[<p>As noted in a previous blog post on debugging “The data connection uses windows authentication and user credentials could not be delegated” there are times (very rare times) when the issue is a problem with your Active Directory configuration. I want to reiterate that this is rare and it is usually something as simple as [...]]]></description>
			<content:encoded><![CDATA[<p>As noted in a previous blog post on debugging <a href="the-data-connection-uses-windows-authentication-and-user-credentials-could-not-be-delegated" target="_blank">“The data connection uses windows authentication and user credentials could not be delegated”</a> there are times (very rare times) when the issue is a problem with your Active Directory configuration. I want to reiterate that this is rare and it is usually something as simple as the c2wts service is not running. However, we have now seen two cases of “mis-configured” Active Directories which have led to this problem. It can manifest itself as either you always get this error or you get this error for all users except a couple. To test and see if it is a problem with your Active Directory settings, I am including some code for you to compile and run. At a very low level in Excel Calculation Services, they take the User Principal Name of the interactive user and attempt to convert it to a WindowsIdentity token using c2wts. The code below attempts to do the exact same thing and then just checks for errors and tries to give you some useful information about it (it is derived from <a href="http://msdn.microsoft.com/en-us/library/ee517258.aspx" target="_blank">this</a>). If you compile this application and test the interactive users by attempting to get their WindowsIdentity token and it succeeds for them, then the issue was one of the ones listed earlier in the post on data connection delegation issues. If acquiring the token fails, then you most likely have an AD issue. Dave, Denny and I will try to keep adding information about what the possible configuration errors could be, but here is some code so you can test this on your own and perhaps resolve the whole problem without having to call CSS.</p>
<p><span id="more-1112"></span>Make sure to run this executable as the service account under which Excel Calculation Service is running. If you are not sure what account that is, first go to Central Admin’s “Security” page:</p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2010/05/CentralAdmin_Security.png"><img style="border-width: 0px;" src="http://powerpivotgeek.com/wp-content/uploads/2010/05/CentralAdmin_Security_thumb.png" border="0" alt="CentralAdmin_Security" width="644" height="264" /></a></p>
<p>Then under “General Security” chose “Configure Service Accounts”:</p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2010/05/CentralAdmin_ManageServiceAccounts.png"><img style="border-width: 0px;" src="http://powerpivotgeek.com/wp-content/uploads/2010/05/CentralAdmin_ManageServiceAccounts_thumb.png" border="0" alt="CentralAdmin_ManageServiceAccounts" width="1028" height="307" /></a></p>
<p>In the drop down list on the right side you are looking for a “Service Application Pool” which contains your “Excel Services Application Web Service Application” (in the middle list). The account at the bottom would be the account you want to make sure you run the test application as to accurately simulate what ECS is doing when you are actually using SharePoint. Using the wrong account might give misleading results.</p>
<p>You must provide the User Principle Name (UPN) of the interactive user to the test application. All users have an implicit UPN which can be expressed as &lt;user&gt;@&lt;domain&gt; (I would be <a href="mailto:“leegr@redmond">“leegr@redmond</a>”). You may also have been given an explicit UPN which might look slightly different (although the implicit UPN would still work). If you are concerned that you are not using the right UPN, you can dig through the ULS log to find the UPN associated with the failure. This is the log entry that I got when I turned the c2wts service off:</p>
<blockquote><p>SPSecurityContext.WindowsIdentity: Could not retrieve a valid windows identity for NTName=&#8217;REDMOND\leegr&#8217;, UPN=&#8217;leegr@microsoft.com&#8217;. UPN is required when Kerberos constrained delegation is used.</p></blockquote>
<p>Note that the bit about &#8220;Kerberos” can be ignored because we do not require Kerberos constrained delegation to work (and neither does c2wts … it just returns a limited token in this case which is fine for us). Also, your log entry might look a bit different since I don’t know if they output different things to the log based on the exception type at this level.</p>
<p>To compile this code, you need to link to:</p>
<ul>
<li>Microsoft.IdentityModel</li>
<li>System</li>
<li>System.Core</li>
<li>System.IdentityModel</li>
<li>System.ServiceModel</li>
</ul>
<p> </p>
<p>using System;<br />
using System.Security.Principal;<br />
using System.ServiceModel;<br />
using System.ServiceModel.Security;<br />
using Microsoft.IdentityModel.WindowsTokenService;</p>
<p>namespace C2WTSTest<br />
{<br />
    class Program<br />
    {<br />
        static void OutputUsage()<br />
        {<br />
            Console.WriteLine(&#8220;Usage:&#8221;);<br />
            Console.WriteLine(&#8220;/tc2wtstest.exe &lt;upn&gt;&#8221;);<br />
            Console.WriteLine(&#8220;/tExample: c2wtstest.exe dwickert@redmond&#8221;);<br />
        }</p>
<p>        static void Main(string[] args)<br />
        {<br />
            if ((args.Length != 1) || (string.Compare(args[0], &#8220;/?&#8221;) == 0) || (string.Compare(args[0], &#8220;-?&#8221;) == 0) || (string.Compare(args[0], &#8220;?&#8221;) == 0))<br />
            {<br />
                OutputUsage();<br />
                return;<br />
            }</p>
<p>            string upn = args[0];</p>
<p>            WindowsIdentity windowsIdentity = null;<br />
            if (!String.IsNullOrEmpty(upn))<br />
            {<br />
                try<br />
                {<br />
                    Console.WriteLine(&#8220;Attempting to acquire windows identity for upn: &#8216;{0}&#8217;&#8221;, upn);<br />
                    windowsIdentity = S4UClient.UpnLogon(upn);<br />
                }<br />
                catch (SecurityAccessDeniedException)<br />
                {<br />
                    Console.WriteLine(&#8220;Could not map the upn claim to a valid windows identity. Security Access Denied&#8221;);<br />
                    return;<br />
                }<br />
                catch (EndpointNotFoundException)<br />
                {<br />
                    Console.WriteLine(&#8220;Could not map the upn claim to a valid windows identity because the c2wts service was unavailable&#8221;);<br />
                    return;<br />
                }<br />
                catch (FaultException e)<br />
                {<br />
                    Console.WriteLine(&#8220;Could not map the upn claim to a valid windows identity because the c2wts service returned a fault&#8221;);<br />
                    Console.WriteLine(e.ToString());<br />
                    return;<br />
                }<br />
                catch (Exception e)<br />
                {<br />
                    Console.WriteLine(&#8220;Could not map the upn claim to a valid windows identity because of an unexpected exception&#8221;);<br />
                    Console.WriteLine(e.ToString());<br />
                    return;<br />
                }<br />
            }<br />
            else<br />
            {<br />
                throw new Exception(&#8220;No UPN claim found&#8221;);<br />
            }</p>
<p>            using (WindowsImpersonationContext ctxt = windowsIdentity.Impersonate())<br />
            {<br />
                Console.WriteLine(&#8220;Successfully acquired token and impersonated user: &#8216;{0}&#8217;&#8221;, WindowsIdentity.GetCurrent().Name);<br />
            }</p>
<p>        }<br />
    }<br />
}</p>
<p>HTH<br />
Lee</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F05%2F21%2Ftesting-the-claims-to-windows-token-service-for-different-identities%2F&amp;linkname=Testing%20the%20Claims%20To%20Windows%20Token%20Service%20for%20different%20identities"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/05/21/testing-the-claims-to-windows-token-service-for-different-identities/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A Peek Inside: Allocation. What is it? Why is it important?</title>
		<link>http://powerpivotgeek.com/2010/04/02/a-peek-inside-allocation-what-is-it-why-is-it-important/</link>
		<comments>http://powerpivotgeek.com/2010/04/02/a-peek-inside-allocation-what-is-it-why-is-it-important/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 20:49:30 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[A Peek Inside]]></category>
		<category><![CDATA[Midtier]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/04/02/a-peek-inside-allocation-what-is-it-why-is-it-important/</guid>
		<description><![CDATA[<p>Recently I have been getting some questions about an earlier post that I did around how the PowerPivot inactivity unloading is done. see http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/ for more details. Surely there must be a faster mechanism for unloading data – and there is – but to fully discuss that aspect of the system we need to take [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been getting some questions about an <a href="http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/">earlier post</a> that I did around how the PowerPivot inactivity unloading is done. see <a href="http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/">http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/</a> for more details. Surely there must be a faster mechanism for unloading data – and there is – but to fully discuss that aspect of the system we need to take a step back and talk about how databases get loaded in the first place. I don’t mean the actual loading process (that is another interesting post that I’ll do later on), what I mean is how PowerPivot decides to load something to begin with . . . and <u>where</u> it decides to load it.</p>
<p>PowerPivot provides <u>on-demand</u> loading of embedded databases. What this means is that when a client application makes a connection to a workbook (by placing “server=http://sharepoint_server/site/subsite/doclib/workbook.xlsx;” or “data source=http://…/workbook.xlsx;” on the connection string), then the system looks to see if the workbook’s embedded data has already been loaded. If so, the connection request is routed to that PowerPivot app server. If the embedded data has not yet be located then the system has to go through what we call <em><u>Allocation</u></em>. Allocation is the process of deciding which app server to use to load the data and to load it into that machine’s AS Engine instance (we only allow one AS instance per machine – called &lt;server&gt;\GeminiBI in CTP3 and &lt;server&gt;\PowerPivot in RTM).</p>
<p> <span id="more-809"></span>
<p>PowerPivot ships with two algorithms:</p>
<ol>
<li>Round-robin – where the system just picks the next server in the PowerPivot System Service instance list (using the SP object model – remember PowerPivot is a shared service in SharePoint). </li>
<li>Health-based – where the system polls all of the PowerPivot System Service instances to determine their health and uses the healthiest server as the location for the ‘to-be-loaded database’. </li>
</ol>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2010/04/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://powerpivotgeek.com/wp-content/uploads/2010/04/image_thumb.png" width="564" height="480" /></a> </p>
<p>Notice that round-robin is the default. Round robin is particular good if need to minimize the number of messages flowing through your system as it does not poll any of the servers – it just picks the next one and uses it. Since it does not check to see if that system is the ‘best’ from a memory or CPU perspective, round robin is best used when there is no memory pressure on the servers. It is NOT a good algorithm under heavy load. The heavy load use case was the design point for health-based allocation.</p>
<p>Health-based uses the current CPU and memory usage of the AS instance on each machine to determine the healthiest. But for our purposes the other thing that it does, if it cannot find a server that has memory free (CPU is only used as a tie-breaker), then health-based looks to see if there are any inactive databases that can be unloaded to make memory available for the target database (the embedded data in the workbook). An ‘inactive’ database is those that have no currently opened connections to it. Health-based scans the list of inactive databases in oldest-to-latest last accessed order; until the target amount of memory (1.5X the size of the workbook) is found. Thus multiple databases may be unloaded. The PSS sends XMLA DETACH commands to each database, it loads the target workbook, and then the connection request is forwarded to the right server.</p>
<p>So . . that is what happens. But <u>who</u> is actually doing this work? That is the “geek’ie” part of this post. Rather than using the PSS and having to create a “master” PSS (which would give us a single failure point), we elected to do this work in a distributed manner. Here are the components:</p>
<p><a href="http://powerpivotgeek.com/wp-content/uploads/2010/04/image1.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://powerpivotgeek.com/wp-content/uploads/2010/04/image_thumb1.png" width="567" height="484" /></a> </p>
<p>&#160;</p>
<p>The allocation algorithms run in the WCF proxy code. When a request comes in (a remote procedure call to a method in the PSS), the proxy looks to see if it knows where the target database is located. If the proxy has seen the database before, then it forwards the request to the PSS for that respective endpoint. If the proxy has not yet seen the target database it picks one of the PSS web services at random and invokes a method on it to see if the database is located in the PowerPivot service application database (the so-called instance map, which is a record of what databases are loaded and cached (detached) on each AS engine. There is a 10-minute background thread in the PSS that keeps the local AS engine in-synch with the instance map. The randomly chosen PSS returns the instance map information. If the target database is in the instance map then the proxy forwards the request to that PSS endpoint. And everything is good.</p>
<p>If the target database is not in the instance map information, then the proxy looks to see what allocation algorithm to use. If it is round robin, then the proxy just picks the next server in the PSS instance list. Since there could be many PSS proxies in the farm (e.g. many WFEs, many web applications that might have different IIS application pools, ECS transports, and other backend services that access PowerPivot via msolap, ADOMD.NET, AMO which in turn use the Channel Transport), the actual allocation of servers is likely to appear random or heavily favoring one server. We purposely did not synchronize the picking of the ‘next’ server because that would have placed a hot spot on that particular resource. Round-robin is supposed to be a fast, minimal algorithm – so having it become random over time is considered OK.</p>
<p>If the allocation algorithm is health-based, then the proxy polls each PSS gathering information about CPU, memory and the status and size of memory taken by each database on the servers. The proxy then decides which is the ‘best’ server and what databases to unload (detach) to be able to load the database on that server. The proxy then calls the server to perform the load and forwards the request to that particular machine’s PSS endpoint.&#160; </p>
<p>At any point, in the entire algorithm the proxy is prepared to handle that the ultimate target endpoint that it is given, for example, from its own cache, or from the instance map information, might be wrong and the RPC call may return that the database is not located where the proxy believes it to be. If this happens, the proxy reties. It keeps retrying the number of PSS instances are on the farm. If the proxy is still chasing its tail through all of the pointers and caches in the system, then it gives up and returns an “unable to load database” error to the caller.</p>
<p>So, in summary, i wanted to go over this not to explain allocation itself, but more to make the point that rather than say one simple thing &#8212; “When in doubt, turn on health-based allocation – and let it proactively unload databases.” While not directly tied to inactivity, it is the single biggest &#8216;tuning’ option that you have to clearing resources in a high memory use configuration.</p>
<p>Enjoy. </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F04%2F02%2Fa-peek-inside-allocation-what-is-it-why-is-it-important%2F&amp;linkname=A%20Peek%20Inside%3A%20Allocation.%20What%20is%20it%3F%20Why%20is%20it%20important%3F"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/04/02/a-peek-inside-allocation-what-is-it-why-is-it-important/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Peek Inside: Unloading PowerPivot data</title>
		<link>http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/</link>
		<comments>http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 05:58:18 +0000</pubDate>
		<dc:creator>powerpivotgeek</dc:creator>
				<category><![CDATA[A Peek Inside]]></category>
		<category><![CDATA[Midtier]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/</guid>
		<description><![CDATA[<p>Ok folks. Here comes a cool one.</p>
<p>As I am sure that everyone is aware by now, one of the most powerful new features of PowerPivot is that we do on-demand loading of embedded data. Well, if you are going to load it, then you had better at least think about unload it at some time. [...]]]></description>
			<content:encoded><![CDATA[<p>Ok folks. Here comes a cool one.</p>
<p>As I am sure that everyone is aware by now, one of the most powerful new features of PowerPivot is that we do on-demand loading of embedded data. Well, if you are going to load it, then you had better at least think about unload it at some time. There is probably some law of thermodynamics that applies here.</p>
<p>First rule for deleting data is that we don’t touch data if there are users currently connected to it. But other than that, any databases loaded or cached by the PSS (i.e. their database folder is contained in the SSAS Backup folder tree) are candidates for being unloaded.</p>
<p>There are two ways that databases can be unloaded in PowerPivot:</p>
<p> <span id="more-786"></span>
<p><strong>a)&#160; Inactivity</strong></p>
<p>If a database has not been accessed for a long time, then it is a good idea to start to free up resources for it. However being too aggressive means that you may have to re-read content which places a larger load on SharePoint. One of a farm’s most critical resources is the amount of traffic that has to be moved to and from the content database. So we want to minimize its load as much as possible. This is particularly true if the content is large – which is likely for PowerPivot workbooks. We have designed PowerPivot so that inactivity checking is a two stage algorithm. Every 30 minutes the PowerPivot System Service (PSS) scans the databases in the instance map assigned to the server’s service application looking for:</p>
<ol>
<li>A loaded database with its ‘last accessed’ timestamp longer than <strong>48 hours (2 days)</strong>. If it finds one, the PSS detaches the database from the SSAS instance. The database remains in the cache (a collection of detached databases on a server) so it is available for quickly coming back if a user accesses the database. If this happens, all the PSS has to do is to issue an Attach XMLA command – it does not have to go back to the SharePoint content database and re-read the workbook.</li>
<li>A cached database with its ‘last accessed’ timestamp longer than <strong>120 hours (5 days)</strong>. If it finds one, the PSS deletes the database from the cache by deleting the database folder (and all its files) from the hard disk. If a user accesses the database after it was deleted from the cache then the data has to be re-read from the workbook (which is stored in the SharePoint content database).</li>
</ol>
<p><strong>b)&#160; New Content has arrived</strong></p>
<p>If a file is updated in SharePoint (whether or not file versioning is enabled or not), then the any databases loaded or cached for that file can be unloaded from memory and deleted from the server cache immediately. Ordinarily you would think that it would be over aggressive to delete all old databases.</p>
<p>Every 30 minutes the PSS scans the databases in the instance map assigned to the server’s service application looking for content that is newer than the content loaded or cached. The instance map contains the <font face="Courier New"><strong>SPFileVersion.Created </strong></font>property of the file version that is loaded. If the ‘latest version’ of the file has a <font face="Courier New"><strong>SPFileVersion.Created </strong></font>that is later than the instance map then we know that new content has arrived. If the database is loaded, then we delete the database from the SSAS instance by sending an XMLA Delete command. If the database is cached, then the PSS deletes the database from the cache by deleting the database folder (and all its files) from the hard disk.</p>
<p>Note that we cannot use the SharePoint versioning system to determine if a version has changed. We have to use this timestamp method because the SharePoint versioning system can be disabled. In fact it is disabled by default. When it is disabled all files look like version 1.0. We are able to use the file version “Created” property because files in SharePoint are read-only. There is no in-place editing. If you edit a file, then behind the scenes you are creating a new version and it has the “Created” timestamp of the save operation.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>Being a geek, you are probably asking if you can change any of these thresholds or behaviors. The answer is “Sorry, No. Maybe next version.”</p>
<p>Enjoy!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F03%2F04%2Fa-peek-inside-unloading-powerpivot-data%2F&amp;linkname=A%20Peek%20Inside%3A%20Unloading%20PowerPivot%20data"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/03/04/a-peek-inside-unloading-powerpivot-data/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The data connection uses Windows Authentication and user credentials could not be delegated</title>
		<link>http://powerpivotgeek.com/2010/02/08/the-data-connection-uses-windows-authentication-and-user-credentials-could-not-be-delegated/</link>
		<comments>http://powerpivotgeek.com/2010/02/08/the-data-connection-uses-windows-authentication-and-user-credentials-could-not-be-delegated/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 00:30:15 +0000</pubDate>
		<dc:creator>powerpivotwahoo</dc:creator>
				<category><![CDATA[Midtier]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://powerpivotgeek.com/2010/02/08/the-data-connection-uses-windows-authentication-and-user-credentials-could-not-be-delegated/</guid>
		<description><![CDATA[<p>This is one of the two main errors that users could see from Excel Services when using PowerPivot. This is encountered when refreshing PowerPivot data connections or performing an action which requires re-querying the PowerPivot database, such as clicking on a slicer or expanding a node in a pivot table. To debug, some level of [...]]]></description>
			<content:encoded><![CDATA[<p>This is one of the two main errors that users could see from Excel Services when using PowerPivot. This is encountered when refreshing PowerPivot data connections or performing an action which requires re-querying the PowerPivot database, such as clicking on a slicer or expanding a node in a pivot table. To debug, some level of understanding of what Excel Services is doing is required. For this, I recommend reading an earlier post on this blog by Dave … <a title="http://powerpivotgeek.com/2009/12/11/excel-services-delegation/" href="http://powerpivotgeek.com/2009/12/11/excel-services-delegation/">http://powerpivotgeek.com/2009/12/11/excel-services-delegation/</a>. In general, this is an add-on to Dave’s post which is a quick summary of how to debug this error.</p>
<p> <span id="more-672"></span><a href="http://powerpivotgeek.com/wp-content/uploads/2010/02/UserCredentialsCouldNotBeDelegated.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="UserCredentialsCouldNotBeDelegated" src="http://powerpivotgeek.com/wp-content/uploads/2010/02/UserCredentialsCouldNotBeDelegated_thumb.png" width="244" height="167" /></a>
</p>
<p>Here is a quick list of most likely causes for this error and how to debug and fix them (in order based on my experience of likelihood to be the root cause):</p>
<ul>
<li><span style="text-decoration: underline">Is the Claims to Windows Token Service started on the server running Excel Calculation Service (ECS)?</span> For detailed information on the Claims to Windows Token Service (c2wts), you can read the <a href="http://msdn.microsoft.com/en-us/library/ee517278.aspx" target="_blank">msdn</a> article. This service is turned on when doing a “New Farm” installation of PowerPivot, but if you do an “Existing Farm” installation, or have Excel Calculation Service (ECS) running on a different machine, the Claims to Windows Token Service might not be started. Check to make sure that this service is running on every server on which ECS is running. You can validate this via the “Services on Server” option in SharePoint’s Central Administration web site but it is also important to make sure that this is running from Service Control Manager (SCM accessed via services.msc). <em>There is a known issue after reboot where the c2wts fails to start because of an unexpressed startup dependency on the crypto service. I will add a link to the KB when it is available but until then you can add the dependency manually from SCM or from an administrative command prompt with “sc.exe config c2wts depend= cryptsvc”.This will prevent the problem from reappearing after your next reboot.</em> As per <a title="http://powerpivotgeek.com/2010/01/18/why-you-shouldnt-stop-start-analysis-services-from-scm-when-running-in-sharepoint-integration-mode/" href="http://powerpivotgeek.com/2010/01/18/why-you-shouldnt-stop-start-analysis-services-from-scm-when-running-in-sharepoint-integration-mode/">http://powerpivotgeek.com/2010/01/18/why-you-shouldnt-stop-start-analysis-services-from-scm-when-running-in-sharepoint-integration-mode/</a>, you should not manage SharePoint services from SCM, however SCM is the truth when it comes to whether a service is running and so you should always double check by looking at the state in SCM. If SharePoint indicates that the service is started but it is not actually running per SCM, it is safe to start it from SCM (alternatively you could stop and start it from SharePoint Central Administration). As well as simply managing this service, SharePoint configures the security permissions for this service automatically as part of their setup so that all SharePoint Shared Services (which includes ECS) can use it. If you find that the service is stopped on the machine running ECS, start it. After starting this service, you should not need to do any type of&#160; IisReset to see the system start working. </li>
<li><span style="text-decoration: underline">Is your machine connected to the network?</span> Dave has written a good blog on this also (<a title="http://powerpivotgeek.com/2009/11/06/taking-your-server-off-the-network/" href="http://powerpivotgeek.com/2009/11/06/taking-your-server-off-the-network/">http://powerpivotgeek.com/2009/11/06/taking-your-server-off-the-network/</a>). If you are actually trying to run a PowerPivot demo with a machine which is not on the network, follow the steps in Dave’s blog to configure ECS to use a set of stored credentials for the PowerPivot datasource. If you are not doing this on purpose, then connect back to the network. </li>
<li>The final cause would be that for some reason other than network connectivity, the Claims to Windows Token Service is not able to convert the SAML claims token to a Windows User security token. Dave provides a lot of details on these potential issues. Some quick questions to ask yourself:
<ul>
<li><span style="text-decoration: underline">Is the client user account (the logged in user who is browsing the workbook in IE) a domain account?</span> If the account is a local machine account, then the Claims to Windows Token service will not be able to retrieve a Windows user security token. We do not support this scenario in V1 of PowerPivot. Interactive users must be domain users. For demo purposes in a bind you might try the workaround Dave provided for taking the server off of the network, but I have not personally tested it in this case. </li>
<li><span style="text-decoration: underline">Is the client user account in a different domain than the SharePoint servers?</span> This is completely supported, but there must be a trust relationship established between the two domains. You could verify if a missing trust issue is causing your problems by logging in as a user account in the same domain as the SharePoint servers and try interacting with the workbooks (note that you had to have given that user access to the workbook). If it works for users in the same domain but not for users in other domains, it might be an issue with cross domain trust. Contact your domain admin to figure out what the relationships are setup as. </li>
<li><span style="text-decoration: underline">What account is the Claims to Windows Token Service running as?</span> By default it is configured to run as Local System, and I am not aware of the reasons for changing this configuration (the msdn article also refers to the fact that it should be running as Local System). While there might be a good reason for trying to change it, it is possible that the person who altered it did not understand the implications of this change. You should probably track down the person who changed it and get an understanding of why. If you have permissions, switch it back to Local System and try the scenario again. If it works, you will need to determine why it was changed in the first place. </li>
<li>If you have gotten this far and none of the above have solved your issue, then there is the possibility that you have some custom AD configuration which is causing the issue. Dave points out one possibility:<br />
<blockquote>
<p>The account being used as the Excel Services service account must have AD rights to be able to query the object. One place where we know this restriction comes into play is if you have configured your domain controller to have a subgroup under “Users”, e.g. “Service Accounts”, which is a separate AD group that derives from “Users” –&gt; but I am sure that there are more. AD rights for service accounts is a common problem across all of SharePoint.</p>
</blockquote>
<p>What Dave describes is one possibility where an AD configuration could cause this issue. As we discover more potential AD configurations that could cause this issue, we will try to update this list. If you are comfortable building your own test application and have gotten this far without figuring it out (and feel very confident that it is not #1), you can try running the test application we have posted <a href="http://powerpivotgeek.com/2010/05/21/testing-the-claims-to-windows-token-service-for-different-identities/" target="_blank">here</a> to manually test your ability to acquire a Windows Identity. </p>
</li>
</ul>
</li>
</ul>
<p>Hopefully this list will help you quickly debug and fix this issue on your system. HTH</p>
<p>Lee</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpowerpivotgeek.com%2F2010%2F02%2F08%2Fthe-data-connection-uses-windows-authentication-and-user-credentials-could-not-be-delegated%2F&amp;linkname=The%20data%20connection%20uses%20Windows%20Authentication%20and%20user%20credentials%20could%20not%20be%20delegated"><img src="http://powerpivotgeek.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://powerpivotgeek.com/2010/02/08/the-data-connection-uses-windows-authentication-and-user-credentials-could-not-be-delegated/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
