[Fixed]-How to profile django channels?


Django-silk might be helpful to you in profiling the request and database searching time with following reasons:

  1. It is easy to set by simply adding the configs on settings.py of your Django project.
  2. Can be customised: by using the provided decorator, you can profile the function or methods and get their running performance.
  3. Dynamic setting: you can choose to dynamically allocate silk to methods and also set the profiling rate you want during the running time.

As the documentation states:

Silk is a live profiling and inspection tool for the Django framework. Silk intercepts and stores HTTP requests and database queries before presenting them in a user interface for further inspection

Note: silk may double your database searching time, so it may cause some trouble if you set it on your production environment. However, the increase from silk will be shown separately on the dash board.



Why not stick a monitoring tool something like Kibana or New Relic and monitor why and what’s taking so long for a small payload response. It can tell you the time spent on Python, PostgreSQL and Memcache (Redis).


Leave a comment