<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- Append below entry to configSections. Do not overwrite the full section. -->
    <section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
  </configSections>
  <connectionStrings>
    <add name="MongoDB" connectionString="mongodb://tfb-database" />
    <add name="MySQL" connectionString="server=tfb-database; user id=benchmarkdbuser; password=benchmarkdbpass; database=hello_world" providerName="MySql.Data.MySqlClient" />
    <add name="PostgreSQL" connectionString="server=tfb-database; user id=benchmarkdbuser; password=benchmarkdbpass; database=hello_world" providerName="Npgsql" />
    <!-- Set max pool size to SQL Server's default max_connections value. In practice, we don't seem to be getting close to the max at all. -->
    <add name="SQLServer" connectionString="server=tfb-database; user id=benchmarkdbuser; password=B3nchmarkDBPass; database=hello_world; max pool size=32767" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings>
    <!-- To fully saturate the CPUs, we need to allow the .NET thread pool to create many threads
         when a large burst of requests come in. We do this by boosting the minWorkerThreads value
         from the default of 1 per logical processor to 40 per logical processor. This seems to be
         a little conservative as http://support.microsoft.com/kb/821268 recommends 50.-->
    <add key="minWorkerThreadsPerLogicalProcessor" value="40" />
    <!-- Disable ServiceStack features -->
    <add key="DisabledFeatures" value="MetaData, Soap, Soap11, Soap12" />
    <!-- Disable support for directly accessing *.cshtml/*.vbhtml files because that is a perf killer
         and because we don't use such functionality. -->
    <add key="webpages:Enabled" value="false" />
  </appSettings>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="false" targetFramework="4.5" />
    <httpHandlers>
      <add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <handlers>
      <add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.7.4.0" newVersion="6.7.4.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.13.91" newVersion="2.0.13.91" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="AWSSDK" publicKeyToken="9f476d3089b52be3" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.4" newVersion="2.0.0.4" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>  
  <dataCacheClients>
    <!-- DynamoDb ACS Cache Provider -->
    <dataCacheClient name="default">
      <hosts>
        <host name="[Insert Cache EndPoint]" cachePort="22233" />
      </hosts>
      <securityProperties mode="Message">
        <messageSecurity authorizationInfo="[Encrypted ACS token goes here]">
        </messageSecurity>
      </securityProperties>
    </dataCacheClient>
    <dataCacheClient name="SslEndpoint">
      <hosts>
        <host name="[Insert Cache EndPoint]" cachePort="22243" />
      </hosts>
      <securityProperties mode="Message" sslEnabled="true">
        <messageSecurity authorizationInfo="[Encrypted ACS token goes here]"></messageSecurity>
      </securityProperties>
    </dataCacheClient>
  </dataCacheClients>
</configuration>
