<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx</link><description>One of the comments I made when doing my "first impressions" of the Mirra backup device was that the Windows software starts two separate services running in two different processes. I see this a lot - people architect their product into multiple services</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463104</link><pubDate>Fri, 09 Sep 2005 23:31:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463104</guid><dc:creator>Steve Eck</dc:creator><description>The built-in Windows XP and 2003 utility tasklist.exe can also show the services hosted in a process.&lt;br&gt;&lt;br&gt;&amp;quot;tasklist /svc&amp;quot; will show similar information to &amp;quot;tlist -s&amp;quot;.</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463108</link><pubDate>Fri, 09 Sep 2005 23:38:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463108</guid><dc:creator>Stefan Kuhr</dc:creator><description>I've written a service hosting framework for our company that allows running multiple services in one process via one DLL per each service and we did it for the exact reasons you gave: system resources. But Larry: If shared process services are such a darn good thing, why then doesn't MS document the svchost.exe interfaces so ISVs could use it as well? </description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463122</link><pubDate>Sat, 10 Sep 2005 00:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463122</guid><dc:creator>Stephen Veiss</dc:creator><description>One advantage of running services in their own processes is that it's an awful lot easier to figure out which service is causing a problem and fix it if they're running in separate process.&lt;br&gt;&lt;br&gt;An example: about a week ago, something made one of the WMI services on my machine go haywire. The first indication I had of a problem was the Virtual Memory Low warning message box that Windows displays when forced to increase the size of the swap file.&lt;br&gt;&lt;br&gt;I checked in Task Manager, which showed that the machine had about 2.5Gb allocated, and about 1.5Gb of that was being used by a svchost.exe process.&lt;br&gt;&lt;br&gt;Some playing with tasklist /svc and SysInternal's Process Explorer showed that it was the svchost -k netsvcs instance, which is currently hosting 31 services on my machine. Process Explorer also showed that threads were being created and destroyed at around one-second intervals, and the function name displayed was a Wbem* function. &lt;br&gt;&lt;br&gt;It seemed to be creating and destroying threads at a rate of around one per second, and leaking some memory along with it. Restarting the WMI services stopped the leak from getting worse... but didn't return the allocated 1.5Gb to the system.&lt;br&gt;&lt;br&gt;Compounding the problem somewhat is the fact that not all the services running in that instance of svchost.exe will respond to stop requests. After trying a couple of times to stop and restart them all, I ended up having to stop work and reboot the machine. This was on my personal workstation, so an unexpected reboot isn't a big deal - but it'd be a little more serious if a similar problem occurred on a production server.&lt;br&gt;&lt;br&gt;Of course, you'd hope that you'd never find a memory leak in production anyway, but it happens. When it does, I'd like to be able to restart the offending process whilst affecting as little else as possible. Shared services make that task harder.</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463146</link><pubDate>Sat, 10 Sep 2005 00:52:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463146</guid><dc:creator>LarryOsterman</dc:creator><description>Stefan, that's a good question.  The answer is that people would start putting 3rd party code in the same process as the built-in services.&lt;br&gt;&lt;br&gt;&lt;br&gt;And that in turn turns into a reliability nightmare - when an instance of svchost.exe goes down, it takes out all the services within the svchost, which can totally tank a system.&lt;br&gt;&lt;br&gt;</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463268</link><pubDate>Sat, 10 Sep 2005 04:50:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463268</guid><dc:creator>Shiv</dc:creator><description>I've noticed the same problem as Stephen Viess and have come to the conclusion that perhaps the benefit of running many services in one svchost.exe aren't as great as touted. Once I also had the &amp;quot;svchost -k netsvcs&amp;quot; process running away with more memory than usual. I thought that perhaps restarting the offending service would fix it. But how does one find out which one is the culprit? After hunting around with various tools I gave up and started restarting all the services inside it one by one. Guess what? Just like Stephen mentioned it didn't make any difference! The memory usage remained the same (actually increased by a few %). Something isn't quite right in the svchost mechanism. There should be tools to figure out which service is running away and some way to reclaim its resources. Without that IMHO it might be better to have more processes. After all RAM is cheap these days :) It might make sense to do svchost for some common related services. But IMO &amp;quot;svchost -k netsvcs&amp;quot; is quite the extreme counterproductive example.</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463272</link><pubDate>Sat, 10 Sep 2005 05:14:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463272</guid><dc:creator>Cheong</dc:creator><description>After reading the MSDN page of CreateService, may I ask one question?&lt;br&gt;&lt;br&gt;The article states that the &amp;quot;SERVICE_INTERACTIVE_PROCESS&amp;quot; attribute requires LocalSystem security context. But is it possible to create serivce that can be interactive with desktop, yet just run in normal user account?&lt;br&gt;&lt;br&gt;For example, if I'm writing a FTP server, I think a normal user account for that ftproot folder could be enough.</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463283</link><pubDate>Sat, 10 Sep 2005 06:01:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463283</guid><dc:creator>LarryOsterman</dc:creator><description>Cheong, do a google search for &amp;quot;shatter attack&amp;quot; before you consider deploying a service with the SERVICE_INTERACTIVE_PROCESS flag.  &lt;br&gt;&lt;br&gt;Also note that the SERVICE_INTERACTIVE_PROCESS flag doesn't work correctly in FUS scenarios (the UI only pops up on session 0).&lt;br&gt;&lt;br&gt;For Vista, your service is highly unlikely to work correctly do to some significant security work that's been done to mitigate shatter attacks.  You don't want to EVER pop UI up from a service.&lt;br&gt;</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463357</link><pubDate>Sat, 10 Sep 2005 15:04:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463357</guid><dc:creator>Andreas Häber</dc:creator><description>Interactive services are not available anymore in Vista. From the release notes[1]:&lt;br&gt;&amp;quot;The concept of interactive services is being phased out, starting with Windows Vista versions of Windows. Session 0 is now reserved for services and system processes, and users can no longer interactively log on to session 0. Services that assume session 0 is an interactive session might no longer work correctly. Windows and dialog boxes that were displayed directly from services will not be visible to the user, and the service might stop responding if the user interface (UI) requires user input.&amp;quot;&lt;br&gt;&lt;br&gt;One thing I like with interactive services are for global hotkeys. For example I have one interactive service which registers a hotkey for the ctrl+| (pipe) keys. When this hotkey is fired then the service will move the current window from one monitor over to another one. You could do this with an application running from the taskbar too, but I really dislike using the taskbar for stuff which are supposed to be running in the background.&lt;br&gt;&lt;br&gt;[1] &lt;a rel="nofollow" target="_new" href="http://www.microsoft.com/technet/windowsvista/relnotes.mspx"&gt;http://www.microsoft.com/technet/windowsvista/relnotes.mspx&lt;/a&gt;</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463367</link><pubDate>Sat, 10 Sep 2005 16:47:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463367</guid><dc:creator>Ben</dc:creator><description>&amp;gt;&amp;gt;You don't want to EVER pop UI up from a service. &amp;lt;&amp;lt;&lt;br&gt;&lt;br&gt;What about launching another &amp;quot;normal&amp;quot; program from a service, perhaps using CreateProcessAsUser? Does the same rule apply? Any implications from Vista on that? </description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463374</link><pubDate>Sat, 10 Sep 2005 17:23:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463374</guid><dc:creator>LarryOsterman</dc:creator><description>CPAU will continue to work, it doesn't have the security problems that interactive services have.&lt;br&gt;</description></item><item><title>re: Shared Services</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#463877</link><pubDate>Mon, 12 Sep 2005 09:36:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:463877</guid><dc:creator>Cheong</dc:creator><description>Yes. There is security consideration on allowing a process that run with high privellege to interact with user. That what causing me think to lowering it(i.e. a normal user account will do in many case).&lt;br&gt;&lt;br&gt;And controlling the behaviour within the same application is much more simple than using another program to control it. </description></item><item><title>Breaking Up (shared services) Is(n't) Hard To Do</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#464078</link><pubDate>Mon, 12 Sep 2005 20:58:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:464078</guid><dc:creator>Larry Osterman's WebLog</dc:creator><description>The last time I wrote, I talked about shared services. One of the problems of working with shared services...</description></item><item><title>Nynaeve  &amp;raquo; Blog Archive   &amp;raquo; How least privilege is that service, anyway (or much ado about impersonation) - part 1</title><link>http://blogs.msdn.com/larryosterman/archive/2005/09/09/463018.aspx#4257553</link><pubDate>Mon, 06 Aug 2007 15:00:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4257553</guid><dc:creator>Nynaeve  » Blog Archive   » How least privilege is that service, anyway (or much ado about impersonation) - part 1</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.nynaeve.net/?p=154"&gt;http://www.nynaeve.net/?p=154&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>