0

I am running the Django development server, with multiple people using the website simultaneously. Each time my website is visited, there is a function that Django calls which is computationally expensive, and takes about a second to return. This means that currently, pages are loading very slowly if several people access the website at roughly the same time. This is because I assume that Django will not call this function if it is currently being processed from another user.

Here are some more specific details:

  • I am running Django on Windows Server 2012

  • The function itself computes a number of matrix transformations in NumPy

  • The function does not interact with the database at all, but it does load from the server's hard disk

So, I am wondering what the solution to this is, other than having a faster CPU?

Karnivaurus
  • 22,823
  • 57
  • 147
  • 247
  • 1
    A few more details would be helpful. Like what kind of a function are we talking about- does it do a lot of database writes, have you applied any kind of thread lock on this function. Also what server are you using to serve it and does it have multi-threading enabled. – vabhdman Oct 31 '14 at 15:13
  • Please see my edits. I have not specified any thread locks on the function (as far as I am aware ... I'm not very experienced with multi-threading ... basically I have written nothing about multi-threading into the code myself.) – Karnivaurus Oct 31 '14 at 15:43
  • How are you running Django? Are you still using the development server `manage.py runserver` or have you used IIS, Apache, CherryPy etc. – AndrewS Oct 31 '14 at 16:40
  • I am just using the development server for now...is this a limitation? – Karnivaurus Oct 31 '14 at 16:56

0 Answers0