4

As of right now (2018) what is the http/tcp server used when you set up a luminus template project with its default setting?

I'm reading that luminus uses immutant, however, immutant is a collection of other stuff. and I've also read that the underlying server used in immutant is undertow.

Am I correct in assuming that the default server is undertow? If so, how does the default set up perform with respect to non-blocking IO? Does this server afford a non-blocking event loop architecture like nginx/nodejs?

MFave
  • 1,044
  • 2
  • 8
  • 19

4 Answers4

2

You are correct that Immutant uses Undertow as its web server.

Undertow uses non-blocking IO threads (typically one per CPU core) and also manages a pool of worker threads. To quote their documentation:

The XNIO worker manages both the IO threads, and a thread pool that can be used for blocking tasks. In general non-blocking handlers will run from withing an IO thread, while blocking tasks such as Servlet invocations will be dispatched to the worker thread pool.

IO threads run in a loop. This loop does three things:

  • Run any tasks that have been scheduled for execution by the IO thread
  • Run any scheduled tasks that that have hit their timeout
  • Call Selector.select(), and then invoke any callbacks for selected keys

The obvious difference between this architecture and a node architecture is the separation of the pool of worker threads, which are allowed to block.

I'm afraid I can't speak to comparing actual performance, which would be use-case specific.

Venantius
  • 2,471
  • 2
  • 28
  • 36
2

As of mid-2019, the default HTTP server is Jetty through the luminus-jetty package. This is encoded here, with other supported servers named after the default:

(set-feature "+jetty" #{"+aleph" "+http-kit" "+immutant" "+war"})

Source: Luminus.

1

It looks like it uses immutant by default, but you can choose alternative servers.

nha
  • 17,623
  • 13
  • 87
  • 133
1

As of mid-2020 Liminus has switched to ring-undertow as a default server.

BinaryButterfly
  • 18,137
  • 13
  • 50
  • 91