[python-win32] Technique to limit number of instances of our application under Terminal Server
Lincoln Yeoh
lyeoh at pop.jaring.my
Thu Mar 11 15:04:36 CET 2010
At 09:19 PM 3/9/2010, python at bdurham.com wrote:
>I'm looking for simple ways to monitor and limit the number of
>instances of our Python application that gets run on our in-house
>Terminal Servers (2003 and 2008).
>
>The purpose of this restriction is to make sure we don't overload
>our servers. This is an internal administrative requirement - I am
>not looking for a licensing solution.
>
>Background: The application in question is written in Python 2.6
>(32-bit). Our Terminal Server environments are used for testing and
>it is not uncommon for the test builds of our application to lock up
>or abort abnormally. Please consider these non-typical circumstances
>when suggesting a solution :)
If the limit is one, then a lazy and dirty way is to bind to a tcp
port (just pick a fixed one that's not used by other services- you
could make it configurable), and exit if the bind fails.
Regards,
Link.
More information about the python-win32
mailing list