We’ve been having yet another performance issue that has taken awhile to fix. This one isn’t related to code though. However, it has been a nightmare to solve. Thankfully we have some Microsoft guys on sight who were able to quickly diagnose the problem and get us moving along.
Some background:
With that, we were noticing a lot of CPU activity even though we really shouldn’t have, but it was strange as CPU would peak at about 45% and the SQL would appear to become very sluggish. Running ad hoc queries took forever, and it was causing our app to run slowly too. In fact, we were normally front-end CPU bound, but when we were having these issues, the front-end sat at about 25% CPU, SQL was at 45% and there were no waits on the SQL server. It was very annoying as there was no place to point the finger at.
As I was digging through things, I noticed that the last geography we did we had set MDOP to 1 (see previous post). As I was slowly going through various SQL configurations I noticed that it was set to 0 on all of the cluster nodes. Needless to say, I talked to a few people, and 1 is apparently the default setting during their buildout, so I changed it.
Miraculously everything was solved! A quality day’s worth of work! Ran some validation steps, and then handed it off to our offshore team. The next day, I notice that the results were looking a lot worse that what I was seeing. I spin up LoadRunner (ugh, another post I should probably write about) and run a test. My results are for crap too. Looking at front-end CPU, I notice it is once again not maxing out, and SQL is running hot again.
I know how to fix this though, so I go and look at the MDOP setting. Interesting, it is still set to 1. Well, maybe something is hung someplace, so I set it to 0 then back to 1. Run the test, problem solved, move on to something else.
Well, this continually happens for the next week, and so I send an email asking if anyone has seen this before to the local DBAs and the onsite Microsoft DBAs if they have ever seen MDOP “revert”, but not really. Needless to say, they had never heard of this, but the Microsoft DBA quickly narrowed in on the fact that the cache plan is being dumped when I re-run that configuration. Looking at some memory dumps, he quickly jumped on the TokenAndPermUserStore cache. We also verified it by only flushing that cache and watching the improvements on the site.
The good news is that we are not the only ones having issues with this. MS has actually tried to fix this issue since before SP2. However, nothing, not even in SP3 has actually fixed it. Yet, in SP3 they finally added a few trace flags that can be used to manually set the size of this specific cache. Before I get to telling you how to fix it, here is what is going on.
On the previous geography our SQL tier looked the same except that we only had 24GB of RAM on the SQL nodes, plus our databases were a lot larger because of legacy data. Therefore, we have memory pressure on the box. SQL wants to load all the databases into RAM, but it can’t. Therefore, the caches are continually going through garbage collection. Now, on this current project, we have more than doubled the amount of RAM, and our databases are are tiny in comparison. In fact, all of our databases are effectively in memory. Therefore, we have no memory pressure, and the caches are never collected. They keep growing to sizes that make them useless as they are spending more time in CPU finding the corresponding item (the security token in this case) than just recreating it.
Our SQL nodes are too big. Who knew that was possible?
Now the solution. Microsoft has tons of articles on this, but the one that describes it the best is 927396. The top bullet points explain exactly what we were seeing:
Now there are multiple ways of fixing it, it really depends on how many users are accessing your database. For us, it is very few as we only have application accounts. However, here are your options:
We went with option #2, so we have the default settings, and guess what it works! The downside is that the memory keeps increasing, but we haven’t had a performance issue. I am guessing is that the used memory space is staying consistently the same size, but it is not reclaiming memory, which is causing a memory leak. I am going to work with our DBA this next week to validate that assumption (and make sure it will reclaim the memory at some point), so I will keep this post updated based on what we found.
In addition, I am going to switch MDOP back to 0, and see if SQL isn’t quite as dumb with parallelism as we think it is now.
That’s right folks, almost exactly three years after my first Xbox 360 died (from the exact same issue), my replacement one has also just bit the dust. What is hilarious is that is was doing something so complex as streaming a video from my Media Center PC. Strenuous indeed.
While my Xbox is technically out of standard warranty, because I am once again getting the three light, red ring of death, my warranty is extended 3 years which would expire in December of 2010. Sadly unlike last time, they don’t send you a box, so I have to find adequate shipping materials to send it to them asap.
Since I keep forgetting to check these base performance assumptions prior to digging in, I thought I would list them here with some description. Yes, this is mostly for my personal edification, so deal with it.
I get this every once in a while, and it is quite annoying. Basically all the colors are messed up when you try to log in via RDP. Everything appears black. You can see your cursor, so you can log into machines, but it is very difficult when dialog boxes are around. I found the solution over at server intellect, and wanted to slap it here so that I have an easy place to find it.
A black Remote Desktop Login Screen when connecting to your Windows Server 2003 Server is caused by registry entries changed either through minor corruption or user error. To resolve it, replace the registry entries with the ones in the registry script below. Simply copy and paste the below script into a text file, and rename it “rdpreset.reg”. Right click on the resulting file, and select Merge.
Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Control Panel\Colors]
“ActiveBorder”=“212 208 200”
“ActiveTitle”=“10 36 106”
“AppWorkSpace”=“128 128 128”
“Background”=“102 111 116”
“ButtonAlternateFace”=“181 181 181”
“ButtonDkShadow”=“64 64 64”
“ButtonFace”=“212 208 200”
“ButtonHilight”=“255 255 255”
“ButtonLight”=“212 208 200”
“ButtonShadow”=“128 128 128”
“ButtonText”=“0 0 0”
“GradientActiveTitle”=“166 202 240”
“GradientInactiveTitle”=“192 192 192”
“GrayText”=“128 128 128”
“Hilight”=“10 36 106”
“HilightText”=“255 255 255”
“HotTrackingColor”=“0 0 128”
“InactiveBorder”=“212 208 200”
“InactiveTitle”=“128 128 128”
“InactiveTitleText”=“212 208 200”
“InfoText”=“0 0 0”
“InfoWindow”=“255 255 225”
“Menu”=“212 208 200”
“MenuText”=“0 0 0”
“Scrollbar”=“212 208 200”
“TitleText”=“255 255 255”
“Window”=“255 255 255”
“WindowFrame”=“0 0 0”
“WindowText”=“0 0 0”
This will correct the colors on the login screen to Windows Server default.
As I am sure you gathered from other recent posts, we are using (read: testing) CSS for a lot of stuff. Well, we found out a beautiful new issue when creating and editing projects from the command line.
When you look at MSDN about adding a filter to a Project, you are presented with the following syntax:
/Filter “+text1.txt -*.exe -dir1\ +...\*.jpg”
Needless to say, that is not correct. For AddProj, they syntax has to be correct, but for EditProj, syntax is a lot more lax (the below is the syntax for EditProj). Regardless, everything in the quotes is incorrect. Instead a filter should look like the following:
Filter=+\“text.txt\” -\”*.exe\” -\“dir1\\\” +\”...\\*.jpg\”
They are either updating the MSDN article or creating a KB article about this.
With the release of Power Pack 3 for Windows Home Server, I have been thinking about trying it out. Having an MSDN subscription and a virtual machine host made this quite a bit easier, as I didn’t need to purchase any additional hardware to use it.
Prior to installing WHS, I had a Windows 2008 virtual machine that I installed all my stuff on and had shares. It definitely worked, but some of the cool features of WHS kept me wanting to move in that direction. Things like automated backups of client machines, a console, better managed and accessible shares, and Media Center tie-ins (I have a Win7 virtual machine as a Media Center and an Xbox 360 as the extender). All in all, I think it is definitely going to be a move in the right direction, but that doesn’t mean there weren’t issues getting there. I am going to outline a bunch of them here in the hopes that others can find comfort in the work I have done to resolve them.
Just silly stuff like that, which take awhile to troubleshoot, when they don’t need to. Turn it off.
Protocol mismatch. This computer uses protocol version 6.0.2030.2, but partner computer [server] uses protocol version 6.0.2030.0. A connection cannot be established
This was because the http://server:55000/enrollid/id.aspx webservice that the connector uses on the WHS machine was returning the incorrect version. The only way to fix it that I found was by installing the final build of Power Pack 3. The beta didn’t work, nor did downgrading to a previous PP.
Hopefully this little guide helps someone else out there. As I tinker with it some more, I will probably add additional articles, but it is amazing how long it has taken me to get this silly machine up and running, especially when this is supposed to be an appliance. I know that MS is learning a lot from this, but the polish is still a bit missing, and this is after 3 Service Packs (Power Packs).
Normally on a Windows machine when you attempt to access a share in a different domain you are prompted for credentials. However, there are no copy utilities (copy, xcopy, robocopy, etc) that pass credentials in the command line. Also, as it is an untrusted domain, you simply can’t do a RunAs (need to manually type in a password for that anyways).
The answer was so obvious, I can’t believe it didn’t come to me right away. However, net use, the simplest of commands, is your friend again. Using the following command you can initiate the connection and then copy between the machines as much as you like via normal UNC path.
net use \\[server]\[path] [password] /user:[username]
copy [source] \\[server]\[path]\[more path]
net use \\[server]\[path] /delete /y
By using the following syntax there is no mapped drive. There is simply a stored connection with the associated credentials for the life of the profile or until the delete command is run.