[ANN] Nginx-Clojure v0.2.2 released

285 views
Skip to first unread message

Xfeep Zhang

unread,
May 31, 2014, 12:57:54 PM5/31/14
to clo...@googlegroups.com
Nginx-Clojure is a Nginx module for embedding Clojure or Java programs, typically those Ring based handlers.

Release 0.2.2 contains two updates

1. Fix bug of with Compojure 1.1.5 + Apache Solrj 4.3.0 + httpclient 4.3.2 NPE happens first time then everything is OK (issue #22)
2. Verifying option for auto generated waving configurations needed by coroutine based socket (issue #23)


The binary release can be found from https://sourceforge.net/projects/nginx-clojure/files/
The source files and guide can be found from https://github.com/nginx-clojure/nginx-clojure/blob/master/README.md
The index page for guide can be found from https://github.com/nginx-clojure/nginx-clojure/wiki

There are some core features of Nginx-Clojure:

  1. Compatible with Ring and obviously supports those Ring based frameworks, such as Compojure etc.
  2. Use Java/Clojure code to write a simple nginx rewrite handler to set var before proxy pass
  3. Non-blocking coroutine based socket which is Compatible with Java Socket API and works well with largely existing java library such as apache http client, mysql jdbc drivers. With this feature one java main thread can handle thousands of connections.
  4. Handle multiple sockets parallel in sub coroutines, e.g. we can invoke two remote services at the same time feature
  5. Asynchronous callback API of socket for some advanced usage
  6. Run initialization clojure code when nginx worker starting
  7. Compatible with the Nginx lastest stable version 1.6.0. (Nginx 1.4.x is also ok, older version is not tested and maybe works.)
  8. One of benifits of Nginx is worker processes are automatically restarted by a master process if they crash
  9. Utilizes lazy headers and direct memory operation between Nginx and JVM to fast handle dynamic contents from Clojure or Java code.
  10. Utilizes Nginx zero copy file sending mechanism to fast handle static contents controlled by Clojure or Java code.
  11. Supports Linux x64, Linux x86 32bit, Win32 and Mac OS X. Win64 users can also run it with a 32bit JRE/JDK.

Toni Helenius

unread,
Jun 2, 2014, 5:22:22 AM6/2/14
to clo...@googlegroups.com
Out of interest, how do people use these multiprocess server thingies like nginx-clojure or vert.x with datomic?

Xfeep Zhang

unread,
Jun 3, 2014, 11:52:50 AM6/3/14
to clo...@googlegroups.com
The multiprocess from nginx is quite different with some old server implementations. Within nginx one process can  handle thousands of connections at the same time. But some old server implementations are one process per request.

If your http service is stateless, multiprocess or single process is not important. If your http service should rely on some state store such as session store, with nginx-clojure you have three choices :

  1. Encrypted Cookie store
  2. SharedHashMap to share data among nginx worker processes
  3. Remote Session Store such as Redis, MemCached etc.



--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/-mianyasT5o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xfeep Zhang

unread,
Jun 3, 2014, 12:07:36 PM6/3/14
to clo...@googlegroups.com
Further more  if you use  Encrypted Cookie store Or Remote Session Store to manage your state,  
your http service will become more lightweight and can be easily expanded horizontally, e.g. you can add more computers to host nginx-clojure to run your http service and let one computer with nginx or LVS or haproxy as the front.

Toni Helenius

unread,
Jun 11, 2014, 12:44:22 PM6/11/14
to clo...@googlegroups.com
It does look really cool. What i was wondering about was Datomic's caching of data to peer application process, and limited peers.

Maybe slacker could be used to have datomic in a separate process.
Reply all
Reply to author
Forward
0 new messages