Vert.x 1.2.0.final is released

http://vertx.io/

This release contains some very cool new features. Here are a few of the highlights:

Module System

Vert.x now contains a proper module system and we’re launching a public module repository. We hope to encourage the community to contribute their own modules so they can be re-used by others.

Modules are automatically lazily installed from the repo (if they’re not already installed) when they’re referenced in your Vert.x applications.

Alternatively you can install them manually using `vertx install <module name>`.

Please see the documentations for full details of modules.

Python and CoffeeScript Support

Vert.x now supports both Python and CoffeeScript! Much Kudos to Scott Horn for the almost perfect pull requests he submitted.

Again, please see the website/docs for full information on this.

Other stuff
For a full list of all the other small features and fixes in this release please see githhub issues.

What’s next?

  • Hot redeploy of module. (This is actually almost complete already but just didn’t make it into 1.2)
  • Better testing support.
  • Develop more modules.
  • Scala? Kotlin? support. Stay tuned.
Posted in Uncategorized | 7 Comments

Vert.x 1.1.0.final is released

I’m pleased to announce the release of Vert.x 1.1.0.final.

Highlights include:

 
1) We can now distribute rhino again – no more annoying manual install step
2) Several changes to the event bus including new point to point mode
3) Security changes to the event bus bridge.
 
And several other bugfixes and changes
 
Full changes here:
 
 
Enjoy!
 
Onward with 1.2.0!
Posted in Uncategorized | 1 Comment

A couple of very cool things from the Vert.x community

A node.js compatibility layer project is born.

The idea with this, is you should be able to run existing node.js code/modules within Vert.x

Also this project shows you how to use the popular backbone.js project with Vert.x

Posted in Uncategorized | 4 Comments

Where Vert.x delivers over Node

I like node, I think it does some things very well, and Vert.x clearly takes inspiration from Node.js in the style of the asynchronous APIs.

But node doesn’t do everything well. I’ve highlighted a few areas here:

  1. Event loops. Event loops are great for ‘event-loopy’ type stuff. I.e. actions that don’t take very long. If your app has that kind of behaviour you can really benefit. However not all actions are like that, e.g. long running computations – doing stuff like that on an event loop is plain stupid (remember the Node.js ‘Fibonacci’ discussions?). Also many legacy libraries have blocking APIs – you don’t want to block an event loop. Unlike Node.js Vert.x doesn’t make you do *everything* on an event loop. You can choose instead to run long running tasks or blocking calls using a thread pool if that’s more appropriate.
  2. Single threaded-ness. A node.js instance is single threaded. That means it can use at most one core on your server. In order to scale over your server cores you need to spin up many instances and activate another component which farms requests between them using slow interprocess communication. Vert.x scales across your cores *automatically*. You just write your server, no need to write any more glue. It just works. And it uses intraprocess communication so many objects can be shared *without copying*. I.e. it’s faster
  3. Polyglot. Node.js is JavaScript only. That’s fine if you like JS (and I do), but not everyone does. Vert.x lets you code your server side components in JS, Groovy, Ruby or Java (Scala and Clojure on TODO list)
  4. Other goodies. Vert.x comes with many goodies including a distributed event bus (which goes right into client side JavaScript), SockJS support, a persistor and others, seamlessly integrated out of the box. Yes you can do this with node.js by manually cobbling together many projects. But vert.x does this hard work for you.
Posted in Uncategorized | 3 Comments

Conference appearances coming up

Looking forward to speaking about Vert.x at GOTO Amsterdam next week.

Also.. found out my Vert.x talk for Strangeloop 2012 has been accepted :)

Posted in Uncategorized | Leave a comment

Vert.x vs node.js simple HTTP benchmarks

For a bit of fun, I decided to do a little bit of micro-benchmarking of Vert.x vs node.js HTTP performance.

Firstly, a disclaimer: This isn’t rigorous benchmarking, and I haven’t attempting to benchmark a wide range of use cases (I just test some HTTP stuff here). All the benchmarking is done on a single machine (my desktop). This is not ideal – a good benchmark would have clients and servers on different physical machines and a real network between them. So don’t read too much into these results. (You can read a little bit, just not too much ;) ) In the future, when I can get hold of some real hardware I intend to do some real benchmarking. Until then this will have to do.

Apparatus: All tests were run on my desktop: An AMD Phenom II X6 (that’s a six core, not as good as the latest Intels but pretty good), 8GB RAM (although only a fraction was used in the tests), Ubuntu 11.04.

Versions: vert.x-1.0.final, node.js 0.6.6

The tests:

Test 1 tests the performance of a trivially simple HTTP server which returns a 200-OK for every request.

Test 2 tests a slightly less trivial HTTP server which serves a real static file from the file system. The file is 72 bytes in size and just contains this:

<html>
  <head>
    <title>Some page</title>
  </head>
  <body>
    <h1>Foo!</h1>
  </body>
</html>

The client used was written in Java using Vert.x, and fires requests using 10 connections, and a maximum of 2000 pipelined requests at any one time per connection. I used 6 instances of the client so that means 60 connections in total.

Every 2000 responses received it sends a message on the Vert.x event bus which is picked up by another component which computes the overall and average rates and prints them to the console every three seconds.

Each test was run for 1 minute, and the average (mean) rate taken.

The code is here if you want to see it or try it out yourself.

For comparison I ran each tests against three server setups:

  1. A single node.js server
  2. A single Vert.x server process with 6 event loops.
  3. A node.js server with six child processes forked using the `cluster` module to distribute work out to them

One of the advantages of Vert.x over node.js is a single server instance can utilise all the cores on your server without having to manually fork child processes and without you having to write load-balancing code to farm out requests to the children.

For the Vert.x servers I tested a version of the server for each of the languages we support: currently JavaScript, Ruby, Groovy and Java.

Results:

In this test, the server simply returns 200-OK to each request. I tested Vert.x Java, Ruby, Groovy and JavaScript single server processes running with 6 event loops, against a node.js single server process. Since a node.js server only has 1 event loop, I also show the results for 6 node.js server processes using the cluster module.

As you can see a single Vert.x process hugely outperforms a single node.js process, and also greatly outperforms a cluster of node.js instances.

In this test, it serves a small static file. I tested Vert.x Java, Ruby, Groovy and JavaScript single server processes running with 6 event loops, against a node.js single server process. Since a node.js server only has one event loop, I also show the results for 6 node.js server processes using the cluster module.

For the node results I show the results both for using the `readFile` function to load the file, and also for using streams. For streams – I show three variations – one using a blocking call to stat the file to get the size, another using a non blocking call to stat the file, and a third using chunked transfer encoding (so it needs no stat).

Again, a single Vert.x process hugely outperforms a single node.js process, and also greatly outperforms a cluster of node.js instances.

Summary:

I don’t think I need to say much here. The numbers speak for themselves.

[Edit. I initially wasn't going to provide any summary, but several observers have said I should summarise the results. So here's my summary:]

1. Vert.x is much faster than Node.js when reading the same file from the filesystem more than once. Neither Vert.x nor the JVM is doing any explicit caching, so this is most likely due to the OS caching it (memory mapped files?). In a webserver-type app the same file is likely to be served many times so this is pretty significant
2. Node.js doesn’t appear to scale particularly well using the `cluster` module. The advice from the node.js folks is not to use it (for now). This leaves node with no out-of-the-box way to scale across multiple cores :(
3. Many of the out of the box load testing tools don’t appear to pipeline very much. The Vert.x results are dramatically better when there’s a high degree of pipelining going on.
4. Java on the JVM is extremely fast. No surprises there ;) But what is very encouraging is how the other JVM langs held up – in particular Rhino held up very well against V8 :)

[Second Edit: As I said in my replies, I should never posted the results with Vert.x "crippled". No-one is going to do this in real life. They will just be running Vert.x or Node.js on the same hardware in whatever way they can get it to exploit the available cores. This really makes the "crippled" Vert.x results redundant. So I've removed them. ]

Posted in Uncategorized | 148 Comments

Vert.x 1.0.final is released

It’s been a long road but Vert.x 1.0.final has now been released :)

What is Vert.x ?

Vert.x is the framework for the next generation of asynchronous, effortlessly scalable, concurrent applications.

Vert.x is an event driven application framework that runs on the JVM – a run-time with real concurrency and unrivalled performance. Vert.x then exposes the API in Ruby, Java, Groovy and JavaScript. So you choose what language you want to use. (Scala, Clojure and Python support is on the roadmap too).

We also bundle a host of goodies out-of-the-box including a distributed event bus, Web Sockets, SockJS, a MongoDB persistor and many other features so you can write real applications from the set-off.

Some of the key highlights include:

  • Polyglot. Write your application components in JavaScript, Ruby, Groovy or Java. It’s up to you. Or mix and match several programming languages in a single application.
  • Super simple concurrency model. Vert.x allows you to write all your code as single threaded, freeing you from the hassle of multi-threaded programming. (No more `synchronized`, `volatile` or other explicit concurrency control required).
  • Unlike other popular event driven frameworks, Vert.x takes advantage of the JVM and scales seamlessly over available cores without having to manually fork multiple servers and handle your own inter process communication between them.
  • Vert.x has a super simple, asynchronous programming model for writing truly scalable non-blocking applications.
  • Vert.x includes a distributed event bus that spans the client and server side so your applications components can communicate incredibly easily. The event bus even penetrates into in-browser JavaScript allowing you to create effortless so-called real-time web applications.
  • Vert.x provides real power and simplicity, without being simplistic. No more sprawling xml configuration files.

Vert.x is a community project sponsored by VMware.

Future applications will largely be running on mobile and embedded devices. These demand a platform that can scale with 10s, 100s or even millions of concurrent connections, and allow developers to write scalable, performant applications incredibly easily, in whatever language they prefer.

We believe Vert.x is that platform.

If you don’t want the whole platform, Vert.x can also be used as a library in your Java or Groovy applications to enable them with all the async goodies.

For more information, please visit the website or visit the project on github

There are plenty of code examples, and a tutorial which shows you how to create a real-time web application without any server side code!

We are actively looking to grow the Vert.x community. Please join us on github, or the Google Group and get involved.

There is plenty to do, and we would love to have you on-board.

Posted in Uncategorized | 14 Comments