0

I am working for a big python project from last 3 years with some around 50 members working for that project, so now the project became too much big that atleast to restart that application server, it is taking 1 minute and 20 seconds.

Here the issue is that it is becoming problem for me to modify my scripts and then dump to server and then to restart server.

I am restarting server just to get my changes effected in the server, if I dont restart that server then it is not taking up my modified changes. Is there a way to make that server to take my changes automatically without restarting that python application server. Why is my new changes are not getting considered unless I restart my server, is it because .pyc file not getting generated when I dump my code to server? then is there any way to generate .pyc file while server is running. Thank you.

user2753523
  • 473
  • 2
  • 8
  • 23
  • Importing a python file will be enough to generate the pyc... but these files get generated automatically so there is no need to ever manually create them. Python does cache files you've already used in a given script though - so it's probably that cache that's the 'problem'... – Shadow Dec 22 '17 at 02:34
  • How to clear that cache, could you let me know – user2753523 Dec 22 '17 at 02:35
  • 1
    Try [How do I unload (reload) a Python module?](https://stackoverflow.com/questions/437589/how-do-i-unload-reload-a-python-module) – Shadow Dec 22 '17 at 02:36
  • This question should be clarified more. I think it is just a question about how to hot reload a python module. – Sraw Dec 22 '17 at 02:39
  • Some years ago, I meet a similar problem, so I add a develop interface to my server which allows me to send a request to this interface and let my server reload specific module. – Sraw Dec 22 '17 at 02:42
  • ok could you share that interface to me if possible now, it is becoming too much problem that for every small change, I am restating my server – user2753523 Dec 22 '17 at 02:44
  • Is this a web server? If so, is it possible to configure the web server to spawn a new worker process for each incoming request? That way you wouldn't have to restart it at all. – John Gordon Dec 22 '17 at 02:55
  • It is an application server which is using web.py file – user2753523 Dec 22 '17 at 03:03
  • 1
    A startup time of over a minute usually indicates that some code is executed that does more than initialization work on startup. You should trace down the bottleneck(s). – Klaus D. Dec 22 '17 at 04:52

0 Answers0