Skip to content
Browse files

added config flag 'use_large_ssl_pool = bool()'

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@1026 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 0277691 commit c9bd56d3feb1ffd461320f959c51d71854658498 @klacke committed
Showing with 33 additions and 1 deletion.
  1. +6 −0 include/yaws.hrl
  2. +12 −0 man/yaws.conf.5
  3. +9 −0 src/yaws_config.erl
  4. +6 −1 src/yaws_server.erl
View
6 include/yaws.hrl
@@ -19,6 +19,7 @@
-define(GC_FAIL_ON_BIND_ERR, 64).
-define(GC_PICK_FIRST_VIRTHOST_ON_NOMATCH, 128).
-define(GC_USE_FDSRV, 256).
+-define(GC_USE_LARGE_SSL_POOL, 512).
-define(GC_DEF, (?GC_AUTH_LOG bor ?GC_FAIL_ON_BIND_ERR)).
@@ -40,6 +41,8 @@
((GC#gconf.flags band ?GC_PICK_FIRST_VIRTHOST_ON_NOMATCH) /= 0)).
-define(gc_use_fdsrv(GC),
((GC#gconf.flags band ?GC_USE_FDSRV) /= 0)).
+-define(gc_use_large_ssl_pool(GC),
+ ((GC#gconf.flags band ?GC_USE_LARGE_SSL_POOL) /= 0)).
-define(gc_set_tty_trace(GC, Bool),
GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_TTY_TRACE, Bool)}).
@@ -63,6 +66,9 @@
-define(gc_set_use_fdsrv(GC, Bool),
GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_USE_FDSRV,Bool)}).
+-define(gc_set_use_large_ssl_pool(GC, Bool),
+ GC#gconf{flags = yaws:flag(GC#gconf.flags,?GC_USE_LARGE_SSL_POOL,Bool)}).
+
%% global conf
-record(gconf,{yaws_dir, %% topdir of Yaws installation
trace, %% false | {true,http}|{true,traffic}
View
12 man/yaws.conf.5
@@ -168,6 +168,18 @@ This feature makes it possible to bind to ports < 1024 even when
we're not running as root. It requires the Jungerl package called fd_server
to be properly installed.. The feature doen't (yet) work with SSL.
+.TP
+\fB use_large_ssl_pool = true | false \fR
+SSL servers by default has a pool of pending accept processes.
+
+An SSL connection might include user interaction.
+So while one person has a dialog box on the screen asking him to review
+the server's certificate, no other person is able to establish a new
+connnection to the server unless we run multiple SSL acceptor processes.
+The default is 8, if we set the this configurable, we use 50 pending
+accept processes. So in environments where a large number of slow
+connectors is expected, this configurable makes sense.
+
.SH SERVER PART
Yaws can virthost several webservers on the same ip address as well
View
9 src/yaws_config.erl
@@ -523,6 +523,15 @@ fload(FD, globals, GC, C, Cs, Lno, Chars) ->
false ->
{error, ?F("Expect true|false at line ~w", [Lno])}
end;
+ ["use_large_ssl_pool", '=', Bool] ->
+ case is_bool(Bool) of
+ {true, Val} ->
+ fload(FD, globals,
+ ?gc_set_use_large_ssl_pool(GC,Val),
+ C, Cs, Lno+1, Next);
+ false ->
+ {error, ?F("Expect true|false at line ~w", [Lno])}
+ end;
['<', "server", Server, '>'] -> %% first server
View
7 src/yaws_server.erl
@@ -708,7 +708,12 @@ initial_acceptor(GS) ->
GS#gs.ssl == nossl ->
acceptor(GS);
GS#gs.ssl == ssl ->
- initial_acceptor(GS, 5)
+ GC = GS#gs.gconf,
+ PoolSize = if
+ ?gc_use_large_ssl_pool(GC) -> 50;
+ true -> 8
+ end,
+ initial_acceptor(GS, PoolSize)
end.

0 comments on commit c9bd56d

Please sign in to comment.
Something went wrong with that request. Please try again.