Thanks a ton buddy,
On Tuesday, January 28, 2014 5:45:06 AM UTC-5, Tobias Oberstein wrote:
Am 27.01.2014 23:59, schrieb Chuck James:
> I love autobahn :). Found this solution few month back and
> wrote a complete chat server (web socket) using this in no time.
Great to hear;)
> Now, before I will put my questions on the table let me tell you
> about this server application.
> I wrote it on mac and the production servers will be linux most
Ubuntu is fine for production. OSX has limited power rgd. networking ..
> I tested this server for 110 clients and all those clients were
> messages each second. I can not test it more than that as my system
> browsers crashed. ( this test was on mac). And it went good.
We did tests with 180.000 clients and a messaging rate of 20k/s
> All my questions are to understand that what I should expect from
> production and how to extends it and make it future proof.
> Q1. I don't have much knowledge about autobahn and twisted, no
> does it work internally, the really nice docs are there but it's
> time. I have to push this server to production otherwise company
> pick other team solution which is in java. So will it be fine and
> should not be any surprises or challenges?
Autobahn/Twisted/Python is a dependable stack and ready for production
use on Linux, FreeBSD and Windows. Python is being used in large scale
deployments like OpenStack and Dropbox. Python is just as
"enterprise-grade" as Java.
It's a very general question, but challenges going to production often
involve things like:
- automatic start/restart of your server ("lights out operation")
- OS network tuning
- running on PyPy (not CPython) for best performance
- using secure WebSocket (not the least to overcome issues with locked
down enterprise networks and mobile networks)
> Q2. I am using reactor apis so, this server is a event base server,
> multi-threaded or single-threaded. I am guessing event base but
Yes. Twisted, similar to Nodejs, is a single-threaded, fully
asynchronous (event driven) networking stack.
> Q3. My servers machines are normal systems (quad core xeon with
> RAM about 1 TB hard drive). Will this chat server handle about
> clients (JS/Flash clients) on one System?
We did test Autobahn on a RaspberryPi with 6000 clients:
The Pi has 256MB memory and a 600MHz CPU (think of low-end smartphone
class). Your machine above is orders more capable.
Caveat: using secure WebSocket (TLS) will incur more load on CPU and
memory .. but you have that steam with your hardware.
> Q4. What is the best approach to make it a clustered server, so
> run it on multiple servers systems and all running (lets say 10)
> server will be connected with each other and send/receive chat
As a rule of thumb, the question of clustering for the purpose of
scaling-out should be considered if you expect to have more than
concurrently connected clients. Below that, don't bother.
That being said, you can certainly cook up a custom clustered solution,
but I'd like to point to
which builds on Autobahn.
While Autobahn is a WebSocket/WAMP library/framework, Crossbar.io is a
complete, integrated server product for WAMP based, distributed
applications, that targets:
and database integration (Oracle and PostgreSQL). The approach is to
have Crossbar.io as a generic WAMP routing substrate for connecting
custom WAMP application components.
> Q5. When there is heavy load on this chat server, lets say more
> or messages per second than expected, how will it react? It will
> disconnecting old users or new users, delay in accepting
> delay in messages, hang, just crash, restarts or anything else?
I have never seen nor heard of Autobahn/Twisted crashing - neither on
CPython nor on PyPy. Not a single time.
In general, Autobahn will react gracefully to overload situations. The
primary factor in the underlying technology is the garbage collector of
the Python run-time in use.
CPython: good GC.
PyPy 2.1+: very good GC (in my opinion/experience, better than e.g.
Oracle Hotspot JVM .. don't quote me on that, Oracle might sue us;)
Regarding accepting connections: with appropriate OS network tuning, we
have tested WebSocket connection rates >10k/s - that is full TCP
connection establishment + WebSocket opening handshake.
There are situations that certainly would require more attention. E.g.
you have 10k clients, and one of them is extremely slow. That might
to run-away memory (since Autobahn will buffer up more and more events
to be delivered for that client).
Again, Crossbar.io has built-in protections against issues like this
stuff like DoS attacks (slow TCP or WS opening handshaking).
> Q6. Can php interact with this server (send/receive messages) as
> socket client? Or it's hard and lot of work. Any lib suggestions..
Crossbar.io has a REST API that allows you to publish WAMP events from
any HTTP client, including PHP. You don't need a full-flavored
nor WAMP implementation in PHP.
> Q7. In future we are planning to develop a authentication server
> log server which will run on different machines and this chat server
> will be connected with them using sockets as client. So is it
> that scenarios will start creating problems?
"authentication" is a broad subject .. e.g. do you plan to live
authenticate against a single Microsoft Active Directory system? etc
What are your requirements?
Again: Crossbar.io targets authentication, and also authorization ..
> Q8. I really like this autobahn google group, and always got the
> answers thanks for that. But still asking need to mention to
> ;). Is there a paid support for this incase we will face any
> bad issue? If yes then how much it gonna cost us.
Tavendo offers (remote) consulting services for all phases of custom
Autobahn based projects:
- design & architecture
- code review
- deployment and going to production
- adressing production problems
as well as commercial support for Crossbar.io based solutions.
I send you a PM with details ..
I hope I could answer your questions in sufficient detail - feel
ask more if not ..
> Chuck James.
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it,
> For more options, visit https://groups.google.com/groups/opt_out
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.