From: Steve S. <st...@ag...> - 2010-06-07 21:07:14
|
Hi, We are looking to run multiple Webware instances from a single Webware directory/checkout and can do so by providing configuration differences via command line args. But I noticed that ThreadedAppServer.addSocketHandler() creates files like http.address and adapter.address containing the address:port for each adapter: # write text file with server address adrFile = self.addressFileName(handlerClass) if os.path.exists(adrFile): print "Warning: %s already exists" % adrFile try: os.unlink(adrFile) except OSError: # we cannot remove the file if open(adrFile).read() == adrStr: return # same content, so never mind else: print "Error: Could not remove", adrFile sys.stdout.flush() raise try: f = open(adrFile, 'w') f.write(adrStr) f.close() except IOError: print "Error: Could not write", adrFile sys.stdout.flush() raise Can anyone explain the purpose? Trying to stop running multiple appservers on the same address/port? If so the port will already be bound so the appserver will fail... Thanks, Steve |
From: Christoph Z. <ci...@on...> - 2010-06-08 19:01:04
|
Am 07.06.2010 22:00 schrieb Steve Schwarz: > We are looking to run multiple Webware instances from a single Webware > directory/checkout and can do so by providing configuration differences > via command line args. Just out of curiosity, why do you want to do that? I'm usually running different instances from different working dirs only. > But I noticed that ThreadedAppServer.addSocketHandler() creates files > like http.address and adapter.address containing the address:port for > each adapter: ... > Can anyone explain the purpose? Trying to stop running multiple > appservers on the same address/port? If so the port will already be > bound so the appserver will fail... I think they are only used as a way to communicate the appserver port to some of the adapters, e.g. the CGIAdapter. If you start a second instance, the file should be overwritten with a warning, doesn't this work for you? If you don't want this, you can set a different name for it in the 2nd instance via the AppServer setting "AddressFiles", e.g. '%s.address2' see http://www.webwareforpython.org/WebKit/Docs/Configuration.html#appserver-config -- Christoph |
From: Steve S. <st...@ag...> - 2010-06-08 19:27:29
|
On Tue, Jun 8, 2010 at 2:00 PM, Christoph Zwerschke <ci...@on...> wrote: > Am 07.06.2010 22:00 schrieb Steve Schwarz: > > We are looking to run multiple Webware instances from a single Webware > > directory/checkout and can do so by providing configuration differences > > via command line args. > > Just out of curiosity, why do you want to do that? I'm usually running > different instances from different working dirs only. > We'd like to simplify our deployment. Now our admins have to install Webware multiple times for each appserver instance on multiple servers. It would be easier to just deploy once and have all instance refer to that one check out. We also see better performance running with a pool of single threaded appservers instead of using the ThreadedAppServer. So we are looking to substantially increase the number of AppServers running and don't want to setup dozens of Webware directories that only differ in port number and some logging parameters. > > But I noticed that ThreadedAppServer.addSocketHandler() creates files > > like http.address and adapter.address containing the address:port for > > each adapter: ... > > Can anyone explain the purpose? Trying to stop running multiple > > appservers on the same address/port? If so the port will already be > > bound so the appserver will fail... > > I think they are only used as a way to communicate the appserver port to > some of the adapters, e.g. the CGIAdapter. > We're only using the HTTP adapter for our current tests and it didn't seem to care if that file exists. So I didn't look any further... > > If you start a second instance, the file should be overwritten with a > warning, doesn't this work for you? > > If you don't want this, you can set a different name for it in the 2nd > instance via the AppServer setting "AddressFiles", e.g. '%s.address2' > Thanks I didn't see that config. We'll just specify it also on the command line and now I won't have to override addSocketHandler() anymore > see > > http://www.webwareforpython.org/WebKit/Docs/Configuration.html#appserver-config > > -- Christoph > Best Regards, Steve |
From: Christoph Z. <ci...@on...> - 2010-06-08 19:35:47
|
Am 08.06.2010 21:27 schrieb Steve Schwarz: > We'd like to simplify our deployment. Now our admins have to install > Webware multiple times for each appserver instance on multiple servers. > It would be easier to just deploy once and have all instance refer to > that one check out. Ok, as I understand, your working dir is on a shared directory? > We also see better performance running with a pool of single threaded > appservers instead of using the ThreadedAppServer. Are you using multi-core/multi-processing machines? -- Christoph |
From: Steve S. <st...@ag...> - 2010-06-08 19:50:49
|
On Tue, Jun 8, 2010 at 2:35 PM, Christoph Zwerschke <ci...@on...> wrote: > Am 08.06.2010 21:27 schrieb Steve Schwarz: > > We'd like to simplify our deployment. Now our admins have to install > > Webware multiple times for each appserver instance on multiple servers. > > It would be easier to just deploy once and have all instance refer to > > that one check out. > > Ok, as I understand, your working dir is on a shared directory? > In the process pool install each server would have one checkout shared by 10-20 SingleThreadedAppServer Webware instances. > > > We also see better performance running with a pool of single threaded > > appservers instead of using the ThreadedAppServer. > > Are you using multi-core/multi-processing machines? > Yep. Looks like we are experiencing GIL contention on our compute heavy pages. Refactoring is also going on in the application to solve that problem. Steve |
From: Christoph Z. <ci...@on...> - 2010-06-08 20:56:21
|
Am 08.06.2010 21:44 schrieb Steve Schwarz: > Yep. Looks like we are experiencing GIL contention on our compute heavy > pages. Refactoring is also going on in the application to solve that > problem. Adding an alternative to the MultiThreadedAppServer has been on my todo list for Webware for quite a while already (at least as long we're still running on Python 2 - the GIL may become less problematic with Py 3.2). Maybe a MultiProcessAppServer could be the alternative or somethin with an approach like Concurrence or Twisted. -- Christoph |
From: Steve S. <st...@ag...> - 2010-06-08 21:20:55
|
On Tue, Jun 8, 2010 at 3:56 PM, Christoph Zwerschke <ci...@on...> wrote: > Maybe a MultiProcessAppServer could be the alternative or somethin with > an approach like Concurrence or Twisted. > We are using Twisted to dispatch/maintain the Webware process pool. Will see about possibility of open sourcing our SingleThreadedAppServer and our twisted server as this progresses. Steve |
From: Christoph Z. <ci...@on...> - 2010-06-09 09:01:41
|
Am 08.06.2010 23:20, schrieb Steve Schwarz: > We are using Twisted to dispatch/maintain the Webware process pool. Will > see about possibility of open sourcing our SingleThreadedAppServer and > our twisted server as this progresses. Great. Maybe this can give us some ideas for a new native Webware app server. -- Christoph |