You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import win32serviceutil
import win32service
import cherrypy
class HelloWorld(object):
@cherrypy.expose
def index(self):
return "Hello world!"
class MyService(win32serviceutil.ServiceFramework):
_svc_name_ = "myName"
_svc_display_name_ = "myName"
def SvcDoRun(self):
cherrypy.quickstart(HelloWorld())
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
self.ReportServiceStatus(win32service.SERVICE_STOPPED)
# very important for use with py2exe
# otherwise the Service Controller never knows that it is stopped !
if __name__ == '__main__':
win32serviceutil.HandleCommandLine(MyService)
Hi,
I created this simple service that contains a cherrypy webserver that provides a Hello World page. If I run this web server without a service it takes 0% CPU load. If I run this script above that runs the server as a service, it takes 1% to 1,6% of my CPU. A bit too mouch for doing nothing in my opinion. Why is that happening?
The text was updated successfully, but these errors were encountered:
Hi,
I created this simple service that contains a cherrypy webserver that provides a Hello World page. If I run this web server without a service it takes 0% CPU load. If I run this script above that runs the server as a service, it takes 1% to 1,6% of my CPU. A bit too mouch for doing nothing in my opinion. Why is that happening?
The text was updated successfully, but these errors were encountered: