473,804 Members | 2,225 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Slow startup on Windows service depending on system date (!??)

Occasionally I had been getting a 30-60 second delay when starting a
Windows service written in .NET. Today I stumbled upon a way to
reproduce it without fail:

Set the system date to the 31st of the current month, the service
starts immediately.
Set the system date to the 1st of next month, the service hangs for
30-60 seconds.
Change back to the 31st and it starts immediately again.
etc.

The service:
Main proc consists of ServiceBase.Run (new MyService());
OnStart returns immediately
Compiled in Release mode

Does anyone have any idea what is happening here?

Jul 23 '07 #1
2 2240
Well, the obvious place to look would be in your service code. Are you
performing any date-sensitive work that would be longer when the date is the
first of a month?

If it is not that, then do you have any dependencies on other services
being started up? If so, is it possible that those services are doing
something on the first of the month?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<an******@gmail .comwrote in message
news:11******** **************@ i38g2000prf.goo glegroups.com.. .
Occasionally I had been getting a 30-60 second delay when starting a
Windows service written in .NET. Today I stumbled upon a way to
reproduce it without fail:

Set the system date to the 31st of the current month, the service
starts immediately.
Set the system date to the 1st of next month, the service hangs for
30-60 seconds.
Change back to the 31st and it starts immediately again.
etc.

The service:
Main proc consists of ServiceBase.Run (new MyService());
OnStart returns immediately
Compiled in Release mode

Does anyone have any idea what is happening here?

Jul 23 '07 #2

<an******@gmail .comwrote in message
news:11******** **************@ i38g2000prf.goo glegroups.com.. .
Occasionally I had been getting a 30-60 second delay when starting a
Windows service written in .NET. Today I stumbled upon a way to
reproduce it without fail:

Set the system date to the 31st of the current month, the service
starts immediately.
Set the system date to the 1st of next month, the service hangs for
30-60 seconds.
Change back to the 31st and it starts immediately again.
etc.

The service:
Main proc consists of ServiceBase.Run (new MyService());
OnStart returns immediately
Did you also remove all code from static constructors, constructors, inline
initializers?
Compiled in Release mode

Does anyone have any idea what is happening here?

Jul 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
426
by: matt breedlove | last post by:
(x-posted to microsoft.public.dotnet.general and microsoft.public.dotnet.languages.vb) Hello all. I am currently creating a Windows Service using VB.NET and would like to return an error if something goes wrong during startup, IE: parsing a configuration file. The only way I know of is to throw an exception, and this will prevent the
2
1444
by: Sujatha | last post by:
Hi, I have a windows application developed which can run in system tray. I want to set up the executable to run while the OS starts. One way, i can think of doing it is by writing a windows service which calls my windows application and then set the service to run automatically. I find this a round about way of achieving my target. Could anyone please let me know the ways through which i can run my windows application while starting my...
4
2933
by: SQLScott | last post by:
My esteemed VB.Net gurus, I posted this question a week or so ago and recieved 1 response that helped me somewhat but really did not solve the problem (but I do appreciate the response). I have spent countless hours searching everything I can think of but I cannot solve this problem, so I post again with hopes that someone knows something that will put me on the right track.
2
11813
by: Val3 | last post by:
Hi all. I need to build dll(s) and windows services using VB .NET 2005 Express. When I make File/New project the windows contain only Windows application, Windows control library, Console application, DVD collection starter kit. How can I do? Any suggest? Thanks in advance. VAL
3
1937
by: Trevor | last post by:
This is driving us mad - please help! Back in 2003, I coded a Windows Service in VB.NET for framework v1.1.4322. I deployed it in Nov. 2003, and it worked fine until the end of May 2005, when it choked (see below). We restarted it, and it worked fine for another 7 months until it choked again at the end of Dec. 2005. It has now failed again (mid Feb. 2006). So it's failing more frequently now? OnStart, the service reads a number of...
9
13048
by: SAL | last post by:
I have an ASP.NET 2.0 app that takes about 17 seconds to load on first startup but then is very fast after that. As I understand it from some posts in June, this is caused by the loading of the App Domain. We have both Cold Fusion and ASP.NET apps on this server and the Cold Fusion apps do not display such slowness on their first start up of the day. Is there a way to improve the load times of ASP.NET apps? I'm having to justify to my boss...
10
18099
by: kimiraikkonen | last post by:
Hi there, I figured out, for the first execution for any .NET-powered app such as VB.NET or C#, it takes 7-8 seconds to see main form of "any" application even the application consists of a single form and a button and only 32kb sized. The second execution(without rebooting machine) is done less than a second. This slowdown on startup doesn't occur on non-.NET-powered apps such as VB6, MFC or VC++ 6 applications. If an application is...
4
3235
by: Brian Gideon | last post by:
I'm having a problem with the amount of time it takes to initialize an application pool on IIS 6.0. Upon the first request to an ASP.NET page the worker process (w3wp.exe) starts up. The problem in my case is that it takes more than 5 minutes to begin servicing requests after the initial startup. During that agonizingly long period the process is doing nothing...and I mean absolutely nothing...0% CPU and no memory movement at all. And...
3
1799
by: =?Utf-8?B?RVF1QWw=?= | last post by:
Hi, We have an application developed in VC2005 with mixed code, primarily C++ but using a C# dll for database access (DBUploader), the dll exposes a C++ interface. We are experiencing intermittent failure on startup - no errors or warnings are generated (including in the EventVwr). Once running there are no issues. The process is started either manually or spawned via a Windows service. The dll is compiled with the following compiler...
0
9715
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10603
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.