Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.NET Windows Services - startup performance bug

1 view
Skip to first unread message

Arnie

unread,
Apr 5, 2005, 4:34:31 PM4/5/05
to
We think we have discovered a bug in .NET.

When we create a .NET windows service it take > 90 seconds at boot time to
startup the service, even when the service does nothing. After alot of
investigation and research we have discovered that if we make our service
depend on a number of other system services the problem goes away (for some
reason).

Samples, boot time stats & tools, can be provided if needed.

Has anyone else seen this or have insight here?

-jeff


Bob Grommes

unread,
Apr 5, 2005, 5:47:00 PM4/5/05
to
I created a Windows Service with no dependencies which has been running for
a couple of years now (currently under CLR 1.1) and it works fine, probably
takes 5 seconds to start up.

What does your service do? Does it access something as part of its startup
code that might have network timeout or security issues? Can you write a
log out to a text file from the service at each step of the OnStart and
narrow down where the pause is?

Can you provide some code?

--Bob

"Arnie" <jefferyro...@msn.com> wrote in message
news:eNL$f7hOFH...@TK2MSFTNGP12.phx.gbl...

Arnie

unread,
Apr 12, 2005, 12:27:18 AM4/12/05
to
Nothing special, I think something as simple as creating a global mutex
causes the problem.

Our system uses the "Auto-Logon" feature (no lingering at the login screen).
A .NET windows service adds 90 seconds to system startup while as a C++
service does not. Strange, but after playing with it some if we startup a
few system services as dependencies the extra slow down goes away.

Again, we only see the slow down at system startup, with .NET, and with
Autologon.

I'm working on posting some generic code that illustrates the problem.

Also, I see that there is a "Windows Service(s) for CE" session at the MEDC
conference. I thought Windows CE didn't support background services.

-jeff

"Bob Grommes" <b...@bobgrommes.com> wrote in message
news:usAm%23jiOF...@TK2MSFTNGP12.phx.gbl...

Daniel Moth

unread,
Apr 12, 2005, 4:06:46 PM4/12/05
to
> Also, I see that there is a "Windows Service(s) for CE" session at the
> MEDC conference. I thought Windows CE didn't support background services.
Services.exe takes care of the equivalent on WinCE.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnce50/html/implement_network_service.asp

Note that you cannot have a managed implementation as the CF cannot be
hosted by native code.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Arnie" <jefferyro...@msn.com> wrote in message

news:uw5ArfxP...@TK2MSFTNGP14.phx.gbl...

Arnie

unread,
Apr 13, 2005, 1:32:36 PM4/13/05
to
There is supposed to be support for CLR hosting in Whidbey. Maybe by then we
can do something managed.

The real kicker is that the programming model on CE/Services.exe and XP are
pretty different. We were hoping to do something common across the
platforms.

-arnie

"Daniel Moth" <dmo...@hotmail.com> wrote in message
news:Od7LKs5...@TK2MSFTNGP15.phx.gbl...

Daniel Moth

unread,
Apr 13, 2005, 2:24:41 PM4/13/05
to
> There is supposed to be support for CLR hosting in Whidbey. Maybe by then
> we can do something managed.
That is not correct. You will not be able to host CF 2.0 (much like you
cannot host the CF 1.0 CLR).


"Arnie" <jefferyro...@msn.com> wrote in message

news:O$O0J7EQF...@TK2MSFTNGP09.phx.gbl...

Arnie

unread,
Apr 19, 2005, 4:41:57 PM4/19/05
to
Okay, I had a CF-Whidbey slide deck from Seth Dempsey that showed it was on
the original list. Not a big deal anyway.

-arnie


"Daniel Moth" <dmo...@hotmail.com> wrote in message

news:eWZlxXFQ...@tk2msftngp13.phx.gbl...

Arnie

unread,
May 2, 2005, 1:56:34 PM5/2/05
to
Okay, we finally tracked down the problem.

One of my colleagues Ryan Columbus discovered that there is a significant
performance issue when using the process class in a service startup.

Create a new .NET service and put the following in the OnStart;

Process.GetCurrentProcess().ProcessName

Some logging will show the service takes ~1 min. 30. to start at bootup.
Without the call to process it takes < 1 second.

Any insights here?

-jeff

"Bob Grommes" <b...@bobgrommes.com> wrote in message
news:usAm%23jiOF...@TK2MSFTNGP12.phx.gbl...

0 new messages