2

We're in the process of migrating our servers onto AWS. We have set up a IIS web server and moved a copy of our DB on a RDS SQL Server 2012. Everything has worked ok for a few days until we got this error from the asp.net web site:

Could not open system assembly ''C:\Windows\assembly\GAC_MSIL\microsoft.sqlserver.types\11.0.0.0__89845dcd8080cc91\microsoft.sqlserver.types.dll'': 32(The process cannot access the file because it is being used by another process.). select @@IDENTITY as last_insert_id

After a few seconds my code automatically retried running the query and it worked. But still I'm worried this will happen again when we will have real traffic on our new environment.

The only relevant help I could find on the net is this page https://support.microsoft.com/en-us/kb/3064292 which seems to imply our RDS doesn't have the lastest service pack, but it actually is on the exact same version than our production DB server (11.0.5058.0 SP2 Standard Edition (64-bit)).

Not sure if that's relevant at all but in my web.config I have in <dependentAssembly>:

    <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral"/>
    <bindingRedirect oldVersion="10.0.0.0" newVersion="11.0.0.0"/>

Any help/hint very appreciated as the "big move" to AWS is planned in the next few days and our stress level is now way too high!

Lukasz Szozda
  • 162,964
  • 23
  • 234
  • 275
Johann
  • 12,158
  • 11
  • 62
  • 89

1 Answers1

1

We finally managed to get rid of that error. What we think happened is the SQL Server database didn't have a Maximum server memory set up so it was eating all available memory. As a result that dll could not be loaded in memory and was accessed way too often by multiple DB threads.

Setting a max. memory to something like [total server memory - 2gb] made that issue disappear (and also greatly increased the DB performance)

This is just our guess so I'm not going to accept my answer until someone can confirm this is right or come up with a better explanation.

Johann
  • 12,158
  • 11
  • 62
  • 89