Would old version of mysql caused performance issue in Django

34 views
Skip to first unread message

Kevin Yu

unread,
Jul 18, 2017, 2:00:58 PM7/18/17
to Django users

Hi All,

I'm rewritting an web application using Django 1.11. When i hooked up to my test mysql database (version 5.7), the performance is amazing. The page renders within 1 second. However, when I connect to the existing production mysql (version 5.1), the page takes more than 10 seconds. 

I installed the debug toolbar, and I found out the the query time is actually not the issue. Most of the time are in the CPU. 

I am wondering whether the Django is having issues with older mysql version when Django receives the data and try to map it to objects via ORM.


Felipe Brunelli de Andrade

unread,
Jul 18, 2017, 2:10:40 PM7/18/17
to django...@googlegroups.com
You need to see de CPU load in server.

In your test you probably are using a local machine with no loading... but your produce server I dont know. You need to see in server the webserver too, try to run django-admin runserver <ip>:8000 and see if you have the same issue.

But if you are just connecting to another machine with database, and application is in yur development enviroment, probably is your network.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/21e35905-047c-4d57-9f0c-6012d148597c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Yu

unread,
Jul 18, 2017, 2:17:46 PM7/18/17
to Django users
Hi Felipe,

Thanks for the quick response. I've eliminated it's cpu load on the production server by directing running the query on the mysql and calculation time is very quick. It's unlikely network issue because the ping is pretty quick.

mysql query time on the server:
1063 rows in set (0.00 sec)


ping 172.16.100.131
64 bytes from 172.16.100.131: icmp_seq=2 ttl=62 time=0.316 ms


On Tuesday, July 18, 2017 at 11:10:40 AM UTC-7, Felipe wrote:
You need to see de CPU load in server.

In your test you probably are using a local machine with no loading... but your produce server I dont know. You need to see in server the webserver too, try to run django-admin runserver <ip>:8000 and see if you have the same issue.

But if you are just connecting to another machine with database, and application is in yur development enviroment, probably is your network.
2017-07-18 15:00 GMT-03:00 Kevin Yu <sams...@gmail.com>:

Hi All,

I'm rewritting an web application using Django 1.11. When i hooked up to my test mysql database (version 5.7), the performance is amazing. The page renders within 1 second. However, when I connect to the existing production mysql (version 5.1), the page takes more than 10 seconds. 

I installed the debug toolbar, and I found out the the query time is actually not the issue. Most of the time are in the CPU. 

I am wondering whether the Django is having issues with older mysql version when Django receives the data and try to map it to objects via ORM.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
Message has been deleted

Felipe Brunelli de Andrade

unread,
Jul 18, 2017, 2:43:53 PM7/18/17
to django...@googlegroups.com
Try to debug in chrome.... just press F12 and go to network tab and see the times fot load content

2017-07-18 15:18 GMT-03:00 Kevin Yu <sams...@gmail.com>:

I've eliminated the possibility of mysql performance issue by directly running the query on the database. It's not network issue either since my ping is just fine.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Kevin Yu

unread,
Jul 18, 2017, 3:05:33 PM7/18/17
to Django users


I even noticed when i do runserver on my local to connect to the older version of mysql db, the starting of dev server is noticeably slower.

What I mean is here:
kevin@kevin-OptiPlex-7020:~/repo/Infosite_Django/app$ python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
July 18, 2017 - 19:00:12
Django version 1.11.2, using settings 'infosite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.


On Tuesday, July 18, 2017 at 11:43:53 AM UTC-7, Felipe wrote:
Try to debug in chrome.... just press F12 and go to network tab and see the times fot load content
2017-07-18 15:18 GMT-03:00 Kevin Yu <sams...@gmail.com>:

I've eliminated the possibility of mysql performance issue by directly running the query on the database. It's not network issue either since my ping is just fine.



On Tuesday, July 18, 2017 at 11:00:58 AM UTC-7, Kevin Yu wrote:

Hi All,

I'm rewritting an web application using Django 1.11. When i hooked up to my test mysql database (version 5.7), the performance is amazing. The page renders within 1 second. However, when I connect to the existing production mysql (version 5.1), the page takes more than 10 seconds. 

I installed the debug toolbar, and I found out the the query time is actually not the issue. Most of the time are in the CPU. 

I am wondering whether the Django is having issues with older mysql version when Django receives the data and try to map it to objects via ORM.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Felipe Brunelli de Andrade

unread,
Jul 18, 2017, 3:13:30 PM7/18/17
to django...@googlegroups.com
It seems like some thing in your app view.

Did you try to dump real database and run localy in your workstation?

To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

carlos

unread,
Jul 18, 2017, 3:46:43 PM7/18/17
to django...@googlegroups.com
why you try update the databases 5.1 to 5.7?

try  dumpdate with manage.py django in .json all apps y then loaddata in new database!


cheers


For more options, visit https://groups.google.com/d/optout.



--
att.
Carlos Rocha

Kevin Yu

unread,
Jul 18, 2017, 3:57:38 PM7/18/17
to django...@googlegroups.com
Yes, my local database is actually a mysqldump of the production so in terms of data set, it's the same

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/_EOK0u_We5k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Kevin Yu

unread,
Jul 18, 2017, 4:15:36 PM7/18/17
to Django users
I'm not trying to update database 5.1 to 5.7. I am simplying seeing difference in terms of performance when running against different version of Mysql with same dataset.

Can you please explain how dumpdata could help?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.



--
att.
Carlos Rocha
Reply all
Reply to author
Forward
0 new messages