Re: Running multiple SSL servers on same machine

Alex Rousskov <[email protected]> Fri, 07 Mar 2014 14:45:13 -0700
Newsgroups gmane.comp.web.web-polygraph.user
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------020608020906090603040304
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 03/04/2014 09:05 PM, Alberto Klocker wrote:

> I've been using tasksets as recommended to run multiple instances of the
> polygraph-server on a single machine with great results. However when it
> comes to using SSL on the servers I seem to be hitting a wall.
> 
> Some of my server processes with SSL peak at 100% CPU usage under high
> load tests. If I use tasksets to spread out across cores I find I start
> getting errors because when starting up they create the .pem files in
> /tmp/ with the same names.
> 
> ie all servers create files in /tmp
> named poly-1b5ac501-cert.srl,poly-557ac53b-serverkey.pem  
>  poly-6401b68e-serverkey.pem etc 
> 
> Initially they all used the same myssl.conf file from your example in
> the docs. I tried placing these in different directories with different
> configurations but the files seem to always have the same name. Any
> thoughts on how I can get multiple SSL servers running on one machine?

Yes, please try the attached patch that makes certificate file names
more unique. We use it for SMP testing.


HTH,

Alex.



--------------020608020906090603040304
Content-Type: text/x-diff;
 name="smp-cert-gen-t1.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="smp-cert-gen-t1.patch"

Allow each SMP worker to store generated certificates using filenames
specific to that worker.

The patch appears to work well in one lab environment,
but a better (more reliable/universal) solution may be possible.

Index: src/runtime/SslWrap.cc
===================================================================
--- src/runtime/SslWrap.cc	(revision 13465)
+++ src/runtime/SslWrap.cc	(working copy)
@@ -473,6 +473,8 @@
 	const String path = theWrap->sharingPath();
 	Assert(path.len() > 0);
 	xstd::ChecksumAlg alg;
+	const int seed = LclPermut(rndSslSeed);
+	alg.update(reinterpret_cast<const char*>(&seed), sizeof(seed)); // necessary for SMP
 	alg.update(cmd.data(), cmd.len());
 	alg.update(path.data(), path.len());
 	alg.final();

--------------020608020906090603040304
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Users mailing list
Users-mN9fGWdlm5pku/f+YMZH/di2O/[email protected]
http://www.web-polygraph.org/mailman/listinfo/users

--------------020608020906090603040304--