May echo / print output crash server (RAM)

51 views Asked by At

I experienced an server crash and assume that it was caused by a lack of RAM. I've programed a Basic HTTP Server with Python that accept and handles all requests of my IoT-Devices. Every single peace is logged, which causes a lot of output in debug mode. I'm using an Amazon EC2 Instace and the System-Log gave me some output like "0K upper memory".

Any idea or where I should look at?

Thank you

1

There are 1 answers

0
4r7ur On

If you are sure that printing is causing the problem then you can disable logging in your base HTTP server.Printing logs often slows the server down though never heard about crashing . Make sure you are not going into infinite loop.

Add the following function in the Base http server class to disable logging.

def log_message(self, format, *args):
        return