How to get modules that are called by external methods reloaded?
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours.. Regards Gaute Amundsen
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
Have you tried to go into Edit form of your external method and just hit Save button? This should tell you that External method was updated. -- Maciej Wisniowski
On Friday 19 January 2007 12:13, Maciej Wisniowski wrote:
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
Have you tried to go into Edit form of your external method and just hit Save button? This should tell you that External method was updated.
Most definitely. That updates everything in the file in the Extensions folder, but noting that this file imports. Gaute
I think that when you restart zope, it compiles everything that is in the products directory. So what happens when you compile it for yourself while zope is running ? If you have only one machine, you can setup multiple zope instances to develop and debug on them so that you are not obliged to restart the production instance. Y.Chaouche 2007/1/19, Gaute Amundsen <gaute@div.org>:
On Friday 19 January 2007 12:13, Maciej Wisniowski wrote:
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
Have you tried to go into Edit form of your external method and just hit Save button? This should tell you that External method was updated.
Most definitely. That updates everything in the file in the Extensions folder, but noting that this file imports.
Gaute _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 19 Jan 2007, at 14:09, yacine chaouche wrote:
I think that when you restart zope, it compiles everything that is in the products directory. So what happens when you compile it for yourself while zope is running ?
Sorry, that's just plain wrong. If a PYC file exists for a given PY file and the PY file has not been changed since the PYC file has been created then the module will not be recompiled. jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFsOTERAx5nvEhZLIRAkgOAJwN1OdUZydIXoXw2+Hz+yOwEH6ubACfSc8D tX/z6pFyQ8f0QVVd3X0d9N4= =XT9P -----END PGP SIGNATURE-----
You are right Jens, but I thought that Gaute wanted to apply some modifications to a module and see the results "live", without restarting zope. Y.Chaouche 2007/1/19, Jens Vagelpohl <jens@dataflake.org>:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 19 Jan 2007, at 14:09, yacine chaouche wrote:
I think that when you restart zope, it compiles everything that is in the products directory. So what happens when you compile it for yourself while zope is running ?
Sorry, that's just plain wrong. If a PYC file exists for a given PY file and the PY file has not been changed since the PYC file has been created then the module will not be recompiled.
jens
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)
iD8DBQFFsOTERAx5nvEhZLIRAkgOAJwN1OdUZydIXoXw2+Hz+yOwEH6ubACfSc8D tX/z6pFyQ8f0QVVd3X0d9N4= =XT9P -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
----- Original Message ----- From: "Gaute Amundsen" <gaute@div.org> To: <zope@zope.org> Sent: Friday, January 19, 2007 4:36 AM Subject: [Zope] How to get modules that are called by external methodsreloaded?
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
AFAIK there is no way to reload a module called by an External Method without restarting Zope. I have encountered this situation many many times. If at all possible you should set up a development server so that you can do this more quickly (my restarts take about 10-15 seconds) and not impact production users. If you are really stuck with a single server for production and development one possible work-around is that you could copy the module source code into your external method, develop/debug, then move it out into its own file when has been completed. Jonathan
On Friday 19 January 2007 13:42, Jonathan wrote:
----- Original Message ----- From: "Gaute Amundsen" <gaute@div.org> To: <zope@zope.org> Sent: Friday, January 19, 2007 4:36 AM Subject: [Zope] How to get modules that are called by external methodsreloaded?
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
AFAIK there is no way to reload a module called by an External Method without restarting Zope. I have encountered this situation many many times.
Ok, then :-(
If at all possible you should set up a development server so that you can do this more quickly (my restarts take about 10-15 seconds) and not impact production users.
If you are really stuck with a single server for production and development one possible work-around is that you could copy the module source code into your external method, develop/debug, then move it out into its own file when has been completed.
Jonathan
It was just during a maneuver like that, that I happened to reload a page, before i had swapped two lib folders... Ok. Thanks. Gaute
If you are really stuck with a single server for production and development one possible work-around is that you could copy the module source code into your external method, develop/debug, then move it out into its own file when has been completed. One may try with different Zope setup. I mean use ZEO with 2 zope instances that share sessions between them. With proper load balancer it is possible to almost transparently for the users restart one of the instances, and later, restart the second one. User are switched from one instance to the second and they're not losing their sessions. I've tried this only on a small environment, so I'm not sure how it will work in big, loaded production environment.
-- Maciej Wisniowski
At Friday 19/1/2007 09:42, Jonathan wrote:
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
AFAIK there is no way to reload a module called by an External Method without restarting Zope. I have encountered this situation many many times.
reload(module) inside the E.M., and edit/save it. -- Gabriel Genellina Softlab SRL __________________________________________________ Pregunt�. Respond�. Descubr�. Todo lo que quer�as saber, y lo que ni imaginabas, est� en Yahoo! Respuestas (Beta). �Probalo ya! http://www.yahoo.com.ar/respuestas
Gaute Amundsen wrote at 2007-1-19 10:36 +0100:
Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
You can use Python's "reload" builtin to reload them. Be warned however, that you must reload also any module that contains (has imported) functions defined in the reloaded module. -- Dieter
On Friday 19 January 2007 19:45, Dieter Maurer wrote:
Gaute Amundsen wrote at 2007-1-19 10:36 +0100:
Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
You can use Python's "reload" builtin to reload them.
Be warned however, that you must reload also any module that contains (has imported) functions defined in the reloaded module.
Ah.. to late now, but I wil keep that in mind next time :) Gaute
--On 19. Januar 2007 10:36:04 +0100 Gaute Amundsen <gaute@div.org> wrote:
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
10 minutes is too long. Even Plone starts on modern hardware in about 30 seconds. Are you using persistent ZEO client caches are checked against the ZEO server during the startup phase? -aj
On Friday 19 January 2007 19:51, Andreas Jung wrote:
--On 19. Januar 2007 10:36:04 +0100 Gaute Amundsen <gaute@div.org> wrote:
Subject says it sall. Only way I have found so far is to restart zope, and on a production server, that is not very popular. Takes about 10 minutes on ours..
10 minutes is too long. Even Plone starts on modern hardware in about 30 seconds. Are you using persistent ZEO client caches are checked against the ZEO server during the startup phase?
-aj
Hm... We are using the setup right "out of the box" + apache, with Varnish in front of the most heavily loaded sites. Right now (~24:00), it restarted in about aminute actually, but considering that our DB size is 7030.2M and it contains about 70 virtual hosts, does 10 minutes still seem to long when under heavy load? Gaute
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 20 Jan 2007, at 00:15, Gaute Amundsen wrote:
Right now (~24:00), it restarted in about aminute actually, but considering that our DB size is 7030.2M and it contains about 70 virtual hosts, does 10 minutes still seem to long when under heavy load?
What do you mean "under heavy load"? Do you run all kinds of other "expensive" processes on the same box as the ZEO client? That database size isn't too large and will not cause 10 minute startup. Only the index file is read in during startup, not the whole database - unless your index file does not exist or is corrupt. Then startup can take a very log time. jens -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFsfUWRAx5nvEhZLIRAhbJAJ9Nl6P3xVLoE2AuhUO19WKRfJUrZQCeJSO9 +FVhGFRdAqM9nGv/DCFUSog= =450c -----END PGP SIGNATURE-----
--On 20. Januar 2007 11:55:18 +0100 Jens Vagelpohl <jens@dataflake.org> wrote:
That database size isn't too large and will not cause 10 minute startup. Only the index file is read in during startup, not the whole database - unless your index file does not exist or is corrupt.
..which might be the result of an unclean shutdown. Andreas
On Saturday 20 January 2007 12:00, Andreas Jung wrote:
--On 20. Januar 2007 11:55:18 +0100 Jens Vagelpohl <jens@dataflake.org>
wrote:
That database size isn't too large and will not cause 10 minute startup. Only the index file is read in during startup, not the whole database - unless your index file does not exist or is corrupt.
..which might be the result of an unclean shutdown.
Andreas
That sounds plausible. We don't do restarts during bussines ours unless we absolutely _have_to_ of course. The restarts I am talking about was before we got Varnish up and running, when the frontpage of http://www.dagligvarehandelen.com would take up to one minute to load, and apache server status would report loads of connections in the "reading" state. Thanks for your input. Gaute
participants (8)
-
Andreas Jung -
Dieter Maurer -
Gabriel Genellina -
Gaute Amundsen -
Jens Vagelpohl -
Jonathan -
Maciej Wisniowski -
yacine chaouche