Whats the difference between tornado and node.js? Besides the obvious that they are developed in different languages.
Tornado also wraps Facebook API and has authentication with Facebook, Google, Twitter and everyone else.
31–39 of 39 posts
Whats the difference between tornado and node.js? Besides the obvious that they are developed in different languages.
Tornado also wraps Facebook API and has authentication with Facebook, Google, Twitter and everyone else.
Earlier quoted context omitted.
traditional web servers like apache 2, create processes to handle web applications that are developed in say ruby or python (e.g. phusion passenger, mod_wsgi). from what i understand (correct me if i'm wrong) these processes inherit large overhead in terms of having to load large numbers of libraries so memory usage is quite wasteful.
Shared libraries are just that: shared. They get memory-mapped, and the code is shared between processes. When a program has many threads open, something similar happens: the code is shared between the threads, but they get different stacks. Those stacks are a problem if you're spawning tens of thousands of threads, one for each connection you have open concurrently. You may find yourself running out of memory, or at…
I'm not sure, but I think that with Apache + Django, you get something like: Apache gets request, gives it to Django, Django asks MySQL for a value, waits, waits, waits (taking up lots of memory, but not too much CPU, but your host charges for RAM), waits a little more, gets a value from MySQL, puts it in a template, hands the response to Apache, which then sends the response to the client.
I don't know how programmers can convince themselves that a framework based on callbacks (event driven) is a good idea.
Does it run under Cygwin?
Earlier quoted context omitted.
Based on coroutines or threads?
Aren't events generally cleaner/easier to use than threads? And python doesn't even have true coroutines, does it?
You have to maintain state all the time and keep track of inconsistent/impossible states.
That to me is not cleaner or easier.
I work in one of the big corps, and it never fails, event driven servers tend to be way more buggy.
Python out of the box doesn't have coroutines but you can always use gevent for that.
Python threads are real pthreads, now they are not optimal and should not be used in high load servers, because pthreads are not that light weight when you are running 10k of them. Creating servers based on python threads is as clean as coroutine threads but slower. Hence, coroutines are always favorable over them.
Earlier quoted context omitted.
Aren't events generally cleaner/easier to use than threads? And python doesn't even have true coroutines, does it?
Event driven development is the worst kind of programming because of the extensive use of callbacks and state maintenance/tracking. You never know the control flow by reading the source. You have to maintain state all the time and keep track of inconsistent/impossible states. That to me is not cleaner or easier. I work in one of the big corps, and it never fails, event driven servers tend to be way more buggy. Python…
I agree that if you can get coroutines in your language, then perhaps that's the ideal path to take.