Closed binnn6 closed 5 years ago
It is currently in R&D stage. What would you suggest? We'd like to hear users opinions.
@VBart Based on code for golang, it looks like you're starting a server via C code and then using FFI to interact with golang code. Is that right?
Also Do you have latency and throughput comparison to Netty 4 (netty-transport-native-epoll artifact)?
@rmohta That's right.
As of doing comparison to Netty, currently it doesn't make sense. While the architecture of Unit is designed to show the best performance, but on the current stage of development it's not expected.
@vbart Okay. What is an ideal architecture for Unit? Is it to provide ability to expose APIs and provide a bridge to glue your service code? Something like Servless/fn platform or something else?
Ideally, when it's possible to integrate interpreter or virtual machine and load it as a dynamic module. PHP, Python and Ruby (coming soon) work that way.
Any guy looked at GraalVM project? https://www.graalvm.org/ it's embeddable. GraalVM can be embedded in both managed and native applications. There are existing integrations into OpenJDK, Node.js, Oracle Database, and MySQL. If Oracle Database & MySQL can embed GraalVM, and I think Nginx Unit can embed GraalVM for Java.
@linux-china Thanks. That looks interesting.
Experimental Java web app support added in https://github.com/mar0x/unit/tree/java . Currently it is able to run basic Spring Boot web applications, packaged as war (see https://github.com/mar0x/gs-spring-boot ).
is the plan to support any JVM based language in Unit ?
We are going to implement a servlet container for web applications based on Java Servlet 3.1 Specification. Currently we focus on Java, but I hope the container will work with applications written in other JVM-based languages if the application follows the requirements like other containers do.
To prioritize, we'd like to know more about your application, the language used, and the ultimate goal you aim to achieve when running your application with Unit.
@mar0x we use Clojure within a JVM.
Steve, I've tried basic Clojure web application. Being packaged as a standalone war, it works well under Unit with experimental Java support (https://github.com/mar0x/unit/tree/java).
Static files serving introduced in experimental Java support. Looking for early adopters.
Unit 1.8 may work as Tomcat or Jetty. Please refer to documentation (http://unit.nginx.org/configuration/#configuration-java) for more information.
No support for user/group settings for Java? Or just lack information in the documentation?
@avkarenow http://unit.nginx.org/configuration/#application-objects
Each application object has a number of common options that can be specified for any application regardless of its type.
@VBart which version of Unit works with Java? I am using 1.8.0 but when uploading a JSON config it throws: "The module to run \"java\" is not found among the available application modules. "
@incube8r BETA Java support introduced in Unit 1.8.0. You need to install JSC (Java Servlet Container) module. Please read http://unit.nginx.org/installation/ for you OS or consider installation from sources (http://unit.nginx.org/installation/#source-code).
@mar0x that worked! Thanks!
I tried running a web app that works well with Tomcat, Jetty, and Payara (tested) but Unit does not seem to be able to run it, it throws this error:
Caused by: java.lang.SecurityException: Couldn't parse jurisdiction policy files in: unlimited
at java.base/javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:357)
at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:111)
at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:108)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/javax.crypto.JceSecurity.<clinit>(JceSecurity.java:107)
... 76 more
@mar0x that worked! Thanks!
I tried running a web app that works well with Tomcat, Jetty, and Payara (tested) but Unit does not seem to be able to run it, it throws this error:
Caused by: java.lang.SecurityException: Couldn't parse jurisdiction policy files in: unlimited at java.base/javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:357) at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:111) at java.base/javax.crypto.JceSecurity$1.run(JceSecurity.java:108) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/javax.crypto.JceSecurity.<clinit>(JceSecurity.java:107) ... 76 more
I added the issue here https://github.com/nginx/unit/issues/255
We are going to implement a servlet container for web applications based on Java Servlet 3.1 Specification. Currently we focus on Java, but I hope the container will work with applications written in other JVM-based languages if the application follows the requirements like other containers do.
To prioritize, we'd like to know more about your application, the language used, and the ultimate goal you aim to achieve when running your application with Unit.
Do NGINX Unit supports Servlet 3.1? @mar0x
Do NGINX Unit supports Servlet 3.1?
Yes. @cyberquarks
Unit will work as tomcat or jetty if java supported? Or what it supposed todo?