Link to home
Start Free TrialLog in
Avatar of Greg_L_WER
Greg_L_WERFlag for Canada

asked on

Local Webservice Loosing Connection

Good morning all!  I've got a weird situation on a local webserver that we run in the office.  We have an intranet web site that we use for office admin etc.  Also as part of the same project we have a webservice that is interacted with by a scheduling/time clock application (Windows Forms Application).  We've used this same solution for a few years between 2 offices (connected with a VPN) with no issues.  We have now had to separate the applications into 2 separate instances (1/office).  I got IIS running in the other office and the website is running aok.  The issue is that the time clock application is has lost its connection to the webservice first thing in the morning.  It is scheduled to close after hours each evening so it needs to be run in the morning.  In the morning once it has been run it doesn't have a connection to the service for about 20 minutes (estimate from what I've been told) and then connects properly and runs fine for the rest of the day.  The time clock program polls the service every few seconds.  The odd thing to me is that when the time clock can't access the webservice the web site is accessible on the same PC.  This seems to take a routing issue off the table though maybe I'm missing something...? We have a local DNS server that has an "A" and "PRT" record to the web server IP.  The web site is running on the DNS server.  We also run a scheduled task that purges the DNS records every 5 minutes.  We started doing this years ago as one external website that we frequently use would become inaccessible from time to time and this solved it.  With the assumption that the DNS purging isn’t the fix (as it runs every 5 minutes and the time clock wasn’t working for around 20) what else could it be?  One thing that I noticed that was different on the new server is that IPV6 was enabled and wasn’t on the old server.  The old server is running Server 2008 and the new server is running Server 2012.  Not sure how either of these could be related but were worth mentioning 😊  Any help would be appreciated.

Thanks,
Greg


This is the cache clearing script that we're using
:: @echo off

Dnscmd CRS-DC-1501.CallingwoodRegHQ.com /clearcache

Open in new window


This is the Time Clock config file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <appSettings>
    <add key="CurSite" value="Live" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v12.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IoHService" maxBufferPoolSize="52428800" maxReceivedMessageSize="2147483647">
          <readerQuotas maxStringContentLength="2147483647" maxArrayLength="1638400" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://oh.callingwoodreghq.com/Services/oHService.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IoHService"
        contract="oHService.IoHService" name="BasicHttpBinding_IoHService" />
    </client>
  </system.serviceModel>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
    </roleManager>
  </system.web>
</configuration>

Open in new window

Avatar of Rex
Rex

How do you know that  time clock application has lost its connection to the webservice? Did you check it manually to reach the webservice or by any event logs?
Avatar of Greg_L_WER

ASKER

Hi Rex... We could tell the time clock wasn't connected as it didn't display the current schedule etc.   I'd checked the event log on the PC running the application and found nothing but didn't think of checking the server hosting the service...  Clearly I'm short of coffee this morning :(  Looks like it is a memory issue that's causing the problem.  The server is running 16GB of memory which I'd think would be plenty for a small web site and DNS services... I've attached a couple screen shots showing what's using the memory.  Not sure how 94% of 16GB can be consumed when the top 16 are using under 1GB.  Am I missing something?  Any suggestions on tracking down the culprit?

Thanks,
Greg

Event Viewer Error
WebHost failed to process a request.
 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/45653674
 Exception: System.ServiceModel.ServiceActivationException: The service '/Services/oHService.svc' cannot be activated due to an exception during compilation.  The exception message is: Memory gates checking failed because the free memory (733700096 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.. ---> System.InsufficientMemoryException: Memory gates checking failed because the free memory (733700096 bytes) is less than 5% of total memory.  As a result, the service will not be available for incoming requests.  To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
   at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   --- End of inner exception stack trace ---
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
 Process Name: w3wp
 Process ID: 3644

Open in new window

Screenshot---8_29_2017---9_44_09-AM.png
Screenshot---8_29_2017---9_44_36-AM.png
Screenshot---8_29_2017---9_47_24-AM.png
ASKER CERTIFIED SOLUTION
Avatar of Rex
Rex

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Rex... I'll give it a try and let you know how it goes.
Hi Rex... came across the culprit for the high memory usage which was the real issue.  It was "Enable Dynamic Memory" in the Hyper-V settings.  Switching the VM to 9GB (without dynamic) reduced the memory usage to around 15%.  The setting you suggested will come in handy on another project we run that has this issue very infrequently but unfortunately still does...

Thanks,
Greg