Too many files are opened. Generally speaking, the default is a maximum of 1024 files. You need to increase this value to verify how many files you can execute ulimit -a. Look at the "open files" inside. For more information, please refer to: http:// askubuntu.com/question…
logger = logging.getLogger('mylogger'+str(time.time())) There is a problem with this sentence. If you don't run get_task2 once, you will get a file handle. If you run it too many times, it will of course be exceeded!
This way of writing is inherently bad and the potential risks are too high. It is unreasonable to generate a separate log for each request. The Linux system itself also has a limit on the number of files in a directory. If there are too many requests, the upper limit will be reached and an error will occur.
As for whether the handler is closed or not, it can only be said to be a programming error at best, but having a separate log for each request is completely a wrong way of thinking.
Too many files are opened. Generally speaking, the default is a maximum of 1024 files.
You need to increase this value to verify how many files you can execute ulimit -a. Look at the "open files" inside.
For more information, please refer to: http:// askubuntu.com/question…
logger = logging.getLogger('mylogger'+str(time.time()))
There is a problem with this sentence. If you don't run get_task2 once, you will get a file handle. If you run it too many times, it will of course be exceeded!
This way of writing is inherently bad and the potential risks are too high. It is unreasonable to generate a separate log for each request. The Linux system itself also has a limit on the number of files in a directory. If there are too many requests, the upper limit will be reached and an error will occur.
As for whether the handler is closed or not, it can only be said to be a programming error at best, but having a separate log for each request is completely a wrong way of thinking.