[ANN] Nginx-Clojure 0.4.1 Released.

2015-08-12 Thread Yuexiang Zhang
0.4.1 (2015-08-12)

   1. New Feature: Coroutine based socket supports unix domain socket
   2. New Feature: APIs for Embedding Nginx-Clojure into a standard
   Clojure/Java/Groovy App (issue #86
   https://github.com/nginx-clojure/nginx-clojure/issues/86). This
   feature make debug/test with Nginx Clojure/Java/Groovy handlers very easy.
   3. New Feature: Autodetect jvm_path (issue #85
   https://github.com/nginx-clojure/nginx-clojure/issues/85)
   4. New Feature: Support to use annotation to mark a class or method to
   be suspenable in coroutine context (issue #84
   https://github.com/nginx-clojure/nginx-clojure/issues/84)
   5. Enhancement: Auto send error when meets a non websocket request with
   auto_upgrade_wsis on
   6. Enhancement: Add websocket-upgrade! to server channel API
   7. Enhancement: Add WholeMessageAdapter to make handling small websocket
   messages easier.
   8. Bug Fix: NginxHttpServerChannel.write(ByteBuffer buf) does not reset
   the buffer's position (issue #83
   https://github.com/nginx-clojure/nginx-clojure/issues/83)
   9. Bug Fix: No access to tomcat server 8.24 from nginx-clojure (issue #82
   https://github.com/nginx-clojure/nginx-clojure/issues/82)
   10. Binaries Distribution: Including some java sources for easy debug.
   11. Build Script: Autodetect JNI header files


Below are some simple examples about embedding Nginx-Clojure and we can try
them with  lein repl or debug them in a Java IDE.

[nginx-clojure/nginx-clojure-embed 0.4.1]


For Clojure

;;(1) Start it with ring handler and an options map
;;my-app can be a simple ring hanler or a compojure router.
(run-server my-app {:port 8080})


   ;;(2) Start it with a nginx.conf file
(run-server /my-dir/nginx.conf)

   ;;(3) Start it with a given work dir
(binding [*nginx-work-dir* my-work-dir]
  (run-server ...))

   ;;(4) Stop the server
(stop-server)

For Java

//Start it with ring handler and an options
mapNginxEmbedServer.getServer().start(my.HelloHandler,
ArrayMap.create(port, 8081));

//Start it with with a nginx.conf
fileNginxEmbedServer.getServer().start(/my-dir/nginx.conf);
//Start it with a given work
dirNginxEmbedServer.getServer().setWorkDir(my-work-dir);NginxEmbedServer.getServer().start(...);

//Stop the serverNginxEmbedServer.getServer().stop();

default options:

  error-log, logs/error.log,
  max-connections, 1024,
  access-log, off,
  keepalive-timeout, 65,
  max-threads, 8,
  host, 0.0.0.0,
  port, 8080,


There 's an example about compojure routing and websocket example in the
unit tests source
https://github.com/nginx-clojure/nginx-clojure/blob/master/nginx-clojure-embed/test/clojure/nginx/clojure/test_embed.clj
:


Web Site   http://nginx-clojure.github.io/
Source Hosted on Github https://github.com/nginx-clojure/nginx-clojure
Google Group (mailing list)
https://groups.google.com/forum/#!forum/nginx-clojure

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nginx-Clojure v0.4.0 Release!

2015-07-06 Thread Yuexiang Zhang
Thanks Sean! Glad to see Nginx-Clojure can also work well with nginx mainline
version (1.9.2).
Cheers!

Yuexiang Zhang (Xfeep)

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nginx-Clojure v0.4.0 Release!

2015-07-06 Thread Yuexiang Zhang
Freebsd port upgraded  nginx clojure module from 0.3.0 to 0.4.0!
http://svnweb.freebsd.org/ports?view=revisionrevision=391378

So on Freebsd we can chose clojure module to enable it after run

pkg install nginx
cd /usr/ports/www/nginx
make config

Cheers!
Yuexiang Zhang (Xfeep)

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Nginx-Clojure v0.4.0 Release!

2015-07-05 Thread Yuexiang Zhang
0.4.0 (2015-07-06)

   1. New Feature: Service Side Websocket (issue #73)
   2. New Feature: A build-in Jersey container to support java standard
   RESTful web services (JAX-RS 2.0) (issue #74)
   3. New Feature: Tomcat 8 embedding support (so servlet
   3.1/jsp/sendfile/JSR-356 websocket work within nginx!) (issue #67)
   4. New Feature: Coroutined Based Client Socket Supports to Bind to
   Specified IP Address (issue #69)
   5. New Feature: Handler's Property Configuration (issue #66)
   6. Enhancement: NginxHttpServerChannel can work with Rewrite Handler or
   Access Handler (issue #79)
   7. Enhancement: Configurable Write Buffer Size for SSE or Websocket
   (issue #76)
   8. Bug Fix: When we do not configure jvm_path proxy_pass will not work
   (issue #72)
   9. Bug Fix: nginx worker restart when get the value of header
   X-Forwarded-For (issue #70)
   10. Bug Fix: proxy_cache_path causes crash (issue #64)
   11. Bug Fix: send_timeout does not take effect with
   NginxHttpServerChannel (issue #78)
   12. Bug Fix: Waving tool generates wrong wave information of fuzzing
   classes (issue #80)
   13. Documents : Release History link in README (issue #68)
   14. Binaries Distribution: built with The latest stable Nginx v1.8.0
   which released at 2015-04-21.



   1. Binaries of Releases
   http://sourceforge.net/projects/nginx-clojure/files/ (for linux,
   windows and macosx).  Freebsd users can get old v0.3.0 from
   https://www.freshports.org/www/nginx .
   2. Sources of Releases
   https://github.com/nginx-clojure/nginx-clojure/releases
   3. website : http://nginx-clojure.github.io/

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Nginx-Clojure v0.3.0 Release!

2014-12-11 Thread Yuexiang Zhang
0.3.0 (2014-12-11)

   1. Discard: Directive clojure, clojure_code are no longer supported, use
   handler_type/content_handler_type, handler_name/content_handler_name,
   handler_code/content_handler_code instead.
   2. Discard: Now handler_*** can not be used to declare a nginx worker
   initialization handler, use `jvm_init_handler_*** instead.
   3. New Feature: Supports writing nginx access handler by
   java/clojure/groovy (issue #53)
   4. New Feature: Supports writing nginx header filter by
   java/clojure/groovy (issue #55)
   5. New Feature: Add new directive max_balanced_tcp_connections to make
   nginx auto set worker_connections.
   6. Enhancement: For Java We can use r.setVariable, r.getVariable now if
   r is an instance of NginxJavaRequest.
   7. Deprecated Directives: handler_type, handler_name, handler_code are
   deprecated and maybe will be removed in the next version, add new directive
   content_handler_type, content_handler_code, content_handler_code
   8. New Directives: rewrite_handler_type, access_handler_type,
   header_filter_type, body_filter_type
   9. New Feature: Supports nested locations (issue #56)
   10. Bug Fix : uppercase letters in nginx variable name can not work
   (issue #54)
   11. Bug Fix: The first registered handler will not work if there 's a
   asynchronous reading of request body (issue #51)
   12. Enhancement: handlers_lazy_init can be used to make handler
   initialized lazily or eagerly (issue #52)




   1. Binaries of Releases
   http://sourceforge.net/projects/nginx-clojure/files/
   2. Sources of Releases
   https://github.com/nginx-clojure/nginx-clojure/releases
   3. website : http://nginx-clojure.github.io/

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: Nginx Filter using Nginx-Clojure module

2014-11-18 Thread Yuexiang Zhang
Hi Khan,

So far nginx-clojure has not supported java/clojure filter, please create
an issue on its github site
https://github.com/nginx-clojure/nginx-clojure/issues .
I will make it support this feature as soon as possible.


Regards
Xfeep

On Tue, Nov 18, 2014 at 3:21 AM, Imran Khan imranhkhan1...@gmail.com
wrote:

 Hi Xfeep,

 Thank you for writing a handy module for java and clojure. I need to
 log the response header in DB using a nginx filter. Please tell me is it
 possible to write nginx filter using nginx-clojure module.


 Regards
 Khan

 --
 You received this message because you are subscribed to the Google Groups
 Nginx-Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nginx-clojure+unsubscr...@googlegroups.com.
 To post to this group, send email to nginx-cloj...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nginx-clojure/3df30bed-6381-43e7-b5cb-e7272f696f0a%40googlegroups.com
 https://groups.google.com/d/msgid/nginx-clojure/3df30bed-6381-43e7-b5cb-e7272f696f0a%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nginx-Clojure v0.2.6 Released!

2014-10-10 Thread Yuexiang Zhang
We fixed this problem now.

Both https://nginx-clojure.github.io/ and http://nginx-clojure.github.io/
 can work now.

Regards.
Xfeep

On Sat, Oct 11, 2014 at 9:49 AM, Xfeep xfe...@gmail.com wrote:

 Hi Balduino,

 Thank you.

 This site use CDN http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.0.min.
 js for jquery , so for security the browser won't load these javascript
 source when we access it by HTTPS.

 Regards.
 Xfeep

 On Saturday, October 11, 2014 3:11:52 AM UTC+8, Plinio Balduino wrote:


 Hi Laurens

 Are you trying to access http or https? If you use HTTPSEverywhere like
 me, the browser will try to load the https version, that really doesn't
 work and you'll see only an horizontal strip.

 I hope it can help you

 Xfeep: thank you very much. I'm moving my web applications to
 nginx-clojure and it's really awesome.

 Regards

 P Balduino

 On Fri, Oct 10, 2014 at 12:16 PM, Xfeep xfe...@gmail.com wrote:

 Hi ivh

 Thanks for your notice.

 Do you mean http://nginx-clojure.github.io/ appears to be broken in
 FF32 ?  I can not reproduce it.

 Could you please give more information about it by reporting an issue at
  https://github.com/nginx-clojure/nginx-clojure.github.io/issues/new ?

 Thanks.

 Regards.
 Xfeep

 On Friday, October 10, 2014 10:40:30 PM UTC+8, Laurens Van Houtven wrote:

 Hi xfeep,


 Thanks for the work! Looks awesome. Unfortunately the github website
 appears to be broken in FF32 (displays fine in Chrome).


 cheers
 lvh



 On 10 Oct 2014, at 16:03, Xfeep xfe...@gmail.com wrote:

 
  0.2.6 (2014-10-10)
 
  • Fix Bug: rewrite handler does not handle write event
 correctly with thread pool mode or coroutine mode (issue #43)
  • Fix Bug: built-in jvm variable #{pno} doesn't work (issue
 #44)
  • Fix Bug: rewrite_handler_name does not work without content
 handler (issue #45). Thanks Eric Kubacki for finding this bug.
  • Fix Bug: rewrite handler does not handle write event
 correctly with thread pool mode or coroutine mode (issue #43)
  • Documents : Correct some inaccuracies and add section about
 logging in Chapter More about Nginx-Clojure
  • Binaries: built with the lastest stable Nginx v1.6.2 which
 released at 2014-09-16.
 
 
  Web Site   http://nginx-clojure.github.io/
  Source Hosted on Github https://github.com/nginx-cloju
 re/nginx-clojure
  Google Group (mailing list) https://groups.google.com/foru
 m/#!forum/nginx-clojure
 
  --
  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 the Google
 Groups Clojure group.
  To unsubscribe from this group and stop receiving emails from it,
 send an email to clojure+u...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

  --
 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 the Google
 Groups Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to clojure+u...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@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+unsubscr...@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/1vPRW5x-Uu8/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this 

Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-15 Thread Yuexiang Zhang
Hi Yang,

'\0x09' is the same with '\t' , they get the same byte value 9.  '\0x09'
and '\t' are just different human readable format display.

So for java *Wind ows NT*.equals(*Wind\tows NT*) .

By the way nginx-clojure won't do any converting about this case it just
keep the original value.


Here 's my test about print headers to client :

$ curl -H User-Agent:WindowsNT http://localhost:8080/prheaders

the server reply :

{host localhost:8080, accept */*, user-agent Windows NT}



Xfeep

On Tue, Sep 16, 2014 at 10:14 AM, 扬清风 sfw2005...@gmail.com wrote:

 Hi xfeep,

 How do the nginx_clojure do with special char(even bytes not printable) in
 http message? For example,

 Accept: image/png, image/svg+xml, image/*;q=0.8, */*;q=0.5
 Referer: http://www.cyclingnews.com/
 Accept-Language: zh-CN
 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0)
 like Gecko
 Accept-Encoding: gzip, deflate

 For User-Agent item, I put a tab in the Windows. In this case,
 original Nginx would escapse to Windo\x09ws NT in accesss log. But when I
 fetch this header from Nginx_clojure java handler, the value come to be
 Wind\tows NT. Is there any configuration in Nginx_clojure for this if I
 expect to get escapse value \x09 for tab instead of \t?

 Thank you very much !!!
 Robert.Yang


 On Sunday, September 7, 2014 8:45:59 PM UTC+8, xfeep wrote:

 0.2.5 (2014-09-07)

1. New Feature: Reference variables in jvm_options  different jvm
debug ports for jvm processes (issue #42)
2. New Feature: Server Sent Events(SSE)  Long polling (issue #41,
issue #36)
3. New Feature: Supports 64-bit JDK on 64-bit Windows (issue #40)
4. New Feature: Coroutine based socket supports JDK8 (issue #39)
5. New Feature: More easier to archive Sub/Pub services with
Broadcast Events to all Nginx workers (issue #39)
6. New Feature: Asynchronous Channel a wrapper of asynchronous socket
to make the usage easier (issue #37)
7. Enhancement: Fix--On Windows a little many write events happen and
these events seem useless (issue #35)


 So far Nginx-Clojure have supported:


- Linux x86 32-bit (tested with CentOS 5.10 i386 )
- Linux x64 (tested with CentOS 5.10 x64, Ubuntu  13.10 x64, Alpine
Linux 3.03 x64)
- Windowns x86 32-bit (tested with Windows XP 32-bit)
- Windows X64 (tested with Windows XP 64-bit)
- MacOSX  (tested with MacOSX 10.7 X64)


 Web Site   http://nginx-clojure.github.io/
 Source Hosted on Github https://github.com/nginx-clojure/nginx-clojure
 Google Group (mailing list) https://groups.google.
 com/forum/#!forum/nginx-clojure


  --
 You received this message because you are subscribed to the Google Groups
 Nginx-Clojure group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to nginx-clojure+unsubscr...@googlegroups.com.
 To post to this group, send email to nginx-cloj...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/nginx-clojure/dfe85140-c92b-429c-a060-29bcff425215%40googlegroups.com
 https://groups.google.com/d/msgid/nginx-clojure/dfe85140-c92b-429c-a060-29bcff425215%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] Nginx-Clojure v0.2.5 released!

2014-09-07 Thread Yuexiang Zhang
0.2.5 (2014-09-07)
   
   1. New Feature: Reference variables in jvm_options  different jvm debug 
   ports for jvm processes (issue #42)
   2. New Feature: Server Sent Events(SSE)  Long polling (issue #41, issue 
   #36)
   3. New Feature: Supports 64-bit JDK on 64-bit Windows (issue #40)
   4. New Feature: Coroutine based socket supports JDK8 (issue #39)
   5. New Feature: More easier to archive Sub/Pub services with Broadcast 
   Events to all Nginx workers (issue #39)
   6. New Feature: Asynchronous Channel a wrapper of asynchronous socket to 
   make the usage easier (issue #37)
   7. Enhancement: Fix--On Windows a little many write events happen and 
   these events seem useless (issue #35)


So far Nginx-Clojure have supported:


   - Linux x86 32-bit (tested with CentOS 5.10 i386 )
   - Linux x64 (tested with CentOS 5.10 x64, Ubuntu  13.10 x64, Alpine 
   Linux 3.03 x64)
   - Windowns x86 32-bit (tested with Windows XP 32-bit)
   - Windows X64 (tested with Windows XP 64-bit)
   - MacOSX  (tested with MacOSX 10.7 X64)
   

Web Site   http://nginx-clojure.github.io/
Source Hosted on Github https://github.com/nginx-clojure/nginx-clojure
Google Group (mailing list) 
https://groups.google.com/forum/#!forum/nginx-clojure


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-07 Thread Yuexiang Zhang
Sorry I don't use Immutant + Wildfly and know little about it.

The simple benchmarks including Immutant  Nginx-Clojure can be found from
HERE https://github.com/ptaoussanis/clojure-web-server-benchmarks.

From Nginx-Clojure the most attractive things to us is :


   1. Nginx's architecture is Master + Worker processes, Nginx-Clojure
   embed one JVM in per Worker process. So if any of worker process crashes,
   the other JVM instances can still work and the Master will recreate a new
   Worker process embedding with a new JVM instance.
   2. Nginx's perfect performance when handle even over 10 thousand
   connections
   3. Coroutine based socket let old Java Socket API based app/libraries
   won't lock a thread anymore
   4. IO (Coroutine based socket, Asynchronous socket  Channel) are on top
   of Nginx IO API which is more worldly-wise than Java NIO on huge scalar
   server application.
   5. JVMs are not goot at huge memory management. Configurable multiple
   JVM instances (is the same number of Nginx Worker processes) will  manage
   less memory. e.g. we have ten Nginx Worker processes in one Nginx instance
   every JVM instance will only manage 1/10 memory
   6.  Nginx already has many modules / features such as rate limit , spdy
   , pages cache, image filter etc. Most of them maybe are difficult or less
   effective to be implemented in pure Java world.


Xfeep







On Sun, Sep 7, 2014 at 11:27 PM, gvim gvi...@gmail.com wrote:

 On 07/09/2014 13:45, Yuexiang Zhang wrote:


 0.2.5 (2014-09-07)

  1. New Feature: Reference variables in jvm_options  different jvm
 debug ports for jvm processes (issue #42)
  2. New Feature: Server Sent Events(SSE)  Long polling (issue #41,
 issue #36)
  3. New Feature: Supports 64-bit JDK on 64-bit Windows (issue #40)
  4. New Feature: Coroutine based socket supports JDK8 (issue #39)
  5. New Feature: More easier to archive Sub/Pub services with Broadcast
 Events to all Nginx workers (issue #39)
  6. New Feature: Asynchronous Channel a wrapper of asynchronous socket
 to make the usage easier (issue #37)
  7. Enhancement: Fix--On Windows a little many write events happen and
 these events seem useless (issue #35)



 What are the trade-offs, if any, compared with Immutant + Wildfly (on
 CentOS 6)? Memory usage is of particular interest.

 gvim

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@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+unsubscr...@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/baqWfrei8CE/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Nginx-Clojure v0.2.5 released!

2014-09-07 Thread Yuexiang Zhang
Not only Wildfly but also most of mainstream pure java webservers use
thread pool to handle http requests. Nginx-Clojure can also be configurated
to use thread pool with one or many JVM instances.

Advanced Java webservers use Java NIO (I/O multipexing) to do the first
phrase (Http request accepting and simple parsing)  then run user business
flow with thread pool. The first phrase only need one or very few threads.
But at the second phrase (using thread pool) largely existing Java Socket
API based libraries such as JDBC drivers, Http Client are  blocking so if
there are many connections they 'll eat up all threads and make the
webserver hang because a OS can only support less threads than connections.
By the way threads in JVM are not cheap and they use more memory than pure
native OS threads and OS threads are pre-emptive and scheduled at constant
time slice so if there are too many threads scheduling will cost too many
of cpu cycles to do real works.

For large scalar application one JVM instance is really not enough. Typical
scenario is we use serveral Java webservers such as tomcat, jetty,
glassfish etc, and
put a reverse proxy such as Nginx, Haproxy, Apache in the front of them.
And Nginx-Clojure make this work easier because it can automatic embed JVM
instances into Nginx worker processes and we need not maintain too many
webservers.

Since JDK 5, JVM instances can share Class data to reduce memory usage and
the startup time for java applications. And on our  enviroment typically we
use coroutine based sockets to work with Apache http client , Solr client
,etc. Coroutines are cooperative and cheaper than threads and be created as
much as our memory can bear.

Xfeep

On Mon, Sep 8, 2014 at 3:27 AM, gvim gvi...@gmail.com wrote:

 On 07/09/2014 17:51, Yuexiang Zhang wrote:


  From Nginx-Clojure the most attractive things to us is :

  1. Nginx's architecture is Master + Worker processes, Nginx-Clojure
 embed one JVM in per Worker process. So if any of worker process
 crashes, the other JVM instances can still work and the Master will
 recreate a new Worker process embedding with a new JVM instance.
  2. Nginx's perfect performance when handle even over 10 thousand
 connections
  3. Coroutine based socket let old Java Socket API based app/libraries
 won't lock a thread anymore
  4. IO (Coroutine based socket, Asynchronous socket  Channel) are on
 top of Nginx IO API which is more worldly-wise than Java NIO on huge
 scalar server application.
  5. JVMs are not goot at huge memory management. Configurable multiple
 JVM instances (is the same number of Nginx Worker processes) will
   manage less memory. e.g. we have ten Nginx Worker processes in one
 Nginx instance every JVM instance will only manage 1/10 memory
  6.   Nginx already has many modules / features such as rate limit ,
 spdy , pages cache, image filter etc. Most of them maybe are
 difficult or less effective to be implemented in pure Java world.


 I'm fairly new to Clojure/JVM but I was under the impression Java
 webservers such as Wildfly (= JBoss) had a reputation for managing memory
 efficiently by spawning threads, ie. only a single JVM instance required?
 Your scenario with multiple JVMs/1 per worker sounds like a much bigger
 memory footprint but, as I said, I'm new to Java.


 gvim

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@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+unsubscr...@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/baqWfrei8CE/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojure+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] nginx-clojure v0.2.4 released

2014-07-25 Thread Yuexiang Zhang
Nginx-Clojure https://github.com/nginx-clojure/nginx-clojure is a Nginx 
module for embedding Clojure / Java / Groovy programs, typically those Ring 
based handlers.

Release 0.2.4 contains  important updates


   1. New Feature: Support Groovy - another dynamic jvm language (issue #34)
   2. Fix bug: Slow Memory Leak for Coroutine based Socket bug (issue #32 )
   3. Fix bug: Should Clone ThreadLocals for Coroutines (issue #31)
   4. New Feature: More friendly to java users who maybe know nothing about 
   clojure feature (issue #29)
   5. Five new nginx directives `handler_type`, `handler_name`, 
   `handler_code`, `rewrite_handler_name`, `rewrite_handler_code`.  Make 
   Clojure/Java/Groovy handler configurations have the same form. e.g. The old 
   pair of nginx directives `clojure`, `clojure_code` is equivalent to 
   `handler_type='clojure'` + `handler_code`.



The binary release (support win32, linux x86 32bit, linux x64, macosx) 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

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@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+unsubscr...@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 the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.