I have been working on a project built with Django. When I run profiler due to slowness of a page in project, this was a line of the result:
10 0.503 0.050 0.503 0.050 {method 'recv_into' of '_socket.socket' objects}
Which says almost 99% of passed time was for the method recv_into(). After some research, I learned the reason is Nagel's algorithm which targets to send packets only when the buffer is full or there are no more packets to transmit. I know I have to disable this algorithm and use TCP_NODELAY but I don't know how, also it should only affect this Django project.
Any help would be much appreciated.