3 ms·
Am I missing something? Django isn't a server, it's a framework. Why was this included in the "benchmark"?
by netnichols 16y ago
Am I missing something? Django isn't a server, it's a framework. Why was this included in the "benchmark"?
- Swizec 16y agoBecause node isn't a server either. It's a framework for handling requests. Also django has all the batteries needed to run as a server and it's interesting to note how much performance is affected when there are too many batteries included.
- piranha 16y agoThis has nothing to do with batteries, but rather with how it works. Comparing ability to process concurrent requests for django vs node is like comparing apples to buildings. They are a bit different.
- Swizec 16y agoYes, but at the end of the day, both django and node get used to handle concurrent requests. It pays off to know how they compare in this task.
- ominous_prime 16y agoNot to beat a dead horse, but django is a framework, the concurrency part is handled by another layer. You were testing how well django's test server handles concurrency; that's all.
- deleted 16y ago[deleted]
- mrud 16y agoThe really big and important difference is that node handles the requests directly and django is served via an additional server like apache/nginx/lighty.
- freyrs3 16y agoThey tested Django development sever which is not meant to be used in production, it's going to be incredibly slow at pretty much everything. A better concurrency benchmark would be running Django with asynchronous gevent workers.
- simonw 16y agoDid you run your benchmark against Django's ./manage.py runserver development server? If so, it's no wonder you got bad results: that server is single threaded and the documentation explicitly warns against ever running it in production.
- anthonyb 16y agoNot just that, but he didn't appear to switch DEBUG off: https://github.com/Swizec/random-coding/blob/master/serverbench/django_bench/settings.py https://github.com/Swizec/random-coding/blob/master/serverbe...
- jerf 16y ago"Also django has all the batteries needed to run as a server" Last I knew, this is not true, and glancing back at the docs for Django it appears to still not be true. It ships with all the batteries for a debug instance of a server, which is meant to help developers work with their Django apps without having to go through a full "deploy to Apache, restart" cycle every time they change anything, but the debug server is not at all intended for production use. Production use requires a dedicated webserver like Apache or nginx. If this benchmark used Django's internal webserver, it's entirely invalid. If it didn't, it ought to say what it did use.
- mrud 16y agoYou are right. node is a i/o framework. And because of that you can write easily servers, like http servers. Which you did. And Django is also a framework. But not for handling i/o requests or writing arbitrary network programs but for writing web applications. But comparing a web application framework with an i/o framework and an http server is comparing apples and oranges. Both are fruits but thats it. But comparing node with django, where the request is handled by another server like nginx/lighty/apache feels somehow really wrong. tl;dr don't just compare two things because both are a framework.