Clojure: What is the default server for the luminus framework?
Asked Answered
S

4

5

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?

Schweiz answered 16/5, 2018 at 2:19 Comment(0)
S
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.

Selfsuggestion answered 17/5, 2018 at 13:23 Comment(0)
S
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.

Stud answered 8/9, 2019 at 19:46 Comment(0)
O
2

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

Olibanum answered 14/7, 2020 at 23:35 Comment(0)
P
1

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

Pelf answered 16/5, 2018 at 11:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.