You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These tips are really useful. Most of them are from real users. Thanks [Rickr Nook](https://github.com/rickr-nook) who give us some useful tips.
93
93
94
-
1. The number of embed JVMs is the same with Nginx `worker_processes`, so if `worker_processes` > 1 we maybe need [nginx-clojure broadcast API][], shared memory (e.g [SharedHashMap/Chronicle-Map][]) or
94
+
1. The number of embed JVMs is the same with Nginx `worker_processes`, so if `worker_processes` > 1 we maybe need [nginx-clojure broadcast API][], shared memory (e.g nginx-clojure built-in [Shared Map][], OpenHFT [ChronicleMap][]) or
95
95
even external service(e.g. redis, database) to coordinate the state or use cookie based session store to manage session information, e.g. [ring.middleware.session.cookie/cookie-store](https://github.com/mmcgrana/ring/wiki/Sessions).
96
96
1. When importing Swing We Must specifiy `jvm_options "-Djava.awt.headless=true"` , otherwise the nginx will hang.
97
97
1. By adding the location of your clojure source files to the classpath,then just issue "nginx -s reload" and changes to the sources get picked up!
@@ -150,7 +150,7 @@ Please Keep these in your mind:
150
150
151
151
* By default if the initialization failed the nginx won't start successfully and the worker will exit after reporting an error message in error log file but the master keep running and take the port.
152
152
* Because the maybe more than one nginx worker processes, so this code will run everytime per worker starting.
153
-
* If you use [Shared Map][], [Chronicle-Map][] to share data
153
+
* If you use nginx-clojure built-in [Shared Map][] or OpenHFT [ChronicleMap][] to share data
154
154
among nginx worker processes, Java file lock can be used to let only one nginx worker process do the initialization.
155
155
* If you [enabled coroutine support][], nginx maybe will start successfully even if your initialization failed after some socket operations. If you case it, you can
156
156
use `nginx.clojure.core/without-coroutine` to wrap your handler, e.g.
<p>The latest release is v0.4.3, more detail changes about it can be found from <ahref="//nginx-clojure.github.io/downloads.html">Release History</a>.</p>
5
5
@@ -39,7 +39,7 @@ <h1>
39
39
<p>By the way it is very fast, the benchmarks can be found <ahref="https://github.com/ptaoussanis/clojure-web-server-benchmarks/">HERE(with wrk2)</a>.</p>
<p>Nginx-Clojure has already been published to <ahref="https://clojars.org/">https://clojars.org/</a> whose maven repository is </p>
45
45
@@ -51,18 +51,18 @@ <h1>
51
51
<p>After adding clojars repository, you can reference nginx-clojure 0.4.3 , e.g.</p>
52
52
53
53
<h2>
54
-
<aid="user-content--leiningen-clojure-no-need-to-add-clojars-repository-which-is-a-default-repository-for-leiningen-" class="anchor" href="#-leiningen-clojure-no-need-to-add-clojars-repository-which-is-a-default-repository-for-leiningen-" aria-hidden="true"><spanclass="octicon octicon-link"></span></a> Leiningen (clojure, no need to add clojars repository which is a default repository for Leiningen) </h2>
54
+
<aid="user-content--leiningen-clojure-no-need-to-add-clojars-repository-which-is-a-default-repository-for-leiningen-" class="anchor" href="#-leiningen-clojure-no-need-to-add-clojars-repository-which-is-a-default-repository-for-leiningen-" aria-hidden="true"><spanaria-hidden="true" class="octicon octicon-link"></span></a> Leiningen (clojure, no need to add clojars repository which is a default repository for Leiningen) </h2>
Copy file name to clipboardExpand all lines: More.md
+11-10Lines changed: 11 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -622,9 +622,9 @@ in nginx.conf
622
622
623
623
If `worker_processes` > 1 there will be more than one jvm instances viz. more tomcat instances so to get synchronized session information we can not use the default tomcat session manger.
624
624
Instead we may consider to use either of
625
-
626
-
1. Cookie based Session Store viz. storing all session attribute information into cookies.
627
-
1. Shared HashMap among processes in the same machine ,e.g. [Chronicle Map](https://github.com/OpenHFT/Chronicle-Map)
625
+
626
+
1. Cookied based Session Store viz. storing all session attribute information into cookies.
627
+
1. Shared HashMap among processes in the same machine ,e.g. nginx-clojure built-in [Shared Map][], OpenHFT [ChronicleMap][]
628
628
1. External Session Store, e.g. Redis / MySQL / Memcached Session Store
629
629
630
630
@@ -673,12 +673,6 @@ location /examples {
673
673
`gzip` can also appear at http, server blocks. More details can be found [HERE](http://nginx.org/en/docs/http/ngx_http_gzip_module.html)
[2.2 Initialization Handler for nginx worker]: configuration.html#user-content-22-initialization-handler-for-nginx-worker
681
-
682
676
3.11 More about Nginx Worker Process
683
677
-----------------
684
678
The number of Nginx worker processes can be configured by nginx directive [worker_processes](http://nginx.org/en/docs/ngx_core_module.html#worker_processes).
@@ -692,10 +686,17 @@ Because a JVM instance will be embeded into per Nginx worker process so if there
692
686
So if we want to get synchronized session information we can not use the default tomcat session manger. Instead we may consider to use either of
693
687
694
688
1. Cookie based Session Store viz. storing all session attribute information into cookies.
695
-
1. Shared HashMap among processes in the same machine ,e.g. [Chronicle Map](https://github.com/OpenHFT/Chronicle-Map)
689
+
1. Shared HashMap among processes in the same machine ,e.g. nginx-clojure built-in [Shared Map][], OpenHFT [ChronicleMap][]
696
690
1. External Session Store, e.g. Redis / MySQL / Memcached Session Store
697
691
698
692
When there are more than one Nginx worker prcocesses sub/pub services also need to be taken care of. Subscribers may connect to JVM instances which maybe are different
699
693
with the JVM instance which the publisher send message to. So we need to use [broadcast API](more.html#35-subpub--broadcast-event) from nginx-clojure
700
694
and broadcast message to all Nginx worker prcocesses.
0 commit comments