把本站的 fastcgi driving script 改成:
#!/your/path/to/python import sys, os from datetime import datetime import traceback try: sys.path.insert(0,'/your/path/to/python/package') os.environ['DJANGO_SETTINGS_MODULE'] = 'yoursite.settings' from django.core.servers.fastcgi import runfastcgi runfastcgi(method="prefork", daemonize="false", maxrequests=100, maxspare=2, minspare=1, maxchildren=5) except Exception, e: logpath = "/your/path/to/traceback.log" if os.path.isfile(logpath): f = open(logpath, 'a') else: f = open(logpath, 'w') f.write("logged at %s :\n"%datetime.now()) traceback.print_exc(file=f) f.write("log end.\n\n") f.close() # vim: set ft=python ai et nu sw=4 ts=4 tw=79:
看看會不會也有幫助。如果 maxrequests=100 有用的話,crontab 就可以丟掉了。
Posted by yungyuc
at 17:53,
0 comment,
0 trackback.