I'm looking at something I'd be able to pull into haraka-net-utils, which handles the tls.ini parsing. When a directory of x509 certificates is specified, read in all the files.
But, for SNI, I need to extract the CN property for each
and then match on the CN to present the correct cert
baudehlo
right
You need to handle a directory of directories too, like letsencrypt uses.
msimerson
Nah
tasansga1 has quit
you aren't supposed to use the certs in the LE directories
tasansga joined the channel
Use your LE client to drop the LE certs into $haraka/config/tls/
it wouldn't be awful to shell out to openssl, b/c it'll only be done at startup and when certs are updated. But forge looks quite promising. Thanks
baudehlo
The problem with the LE client (at least the version I have) is they don't change the exit code when a cert is updated. So you need wrappers for that shit. It's annoying.
is that all that can be done to optimize haraka performance?
also would clustering node.js work?
baudehlo
Yes and no. I'm sure bits of it could be made faster by changing the code.
EyePulp
d4rkmatter: I believe haraka already runs as a cluster of worker processes and a single master
baudehlo
d4rkmatter: just set nodes=cpus in smtp.ini.
EyePulp
d4rkmatter: Are you seeing bottlenecks or performance issues currently that you're looking to correct, or is this premature optimization?
d4rkmatter
im currently facing bottlenecks and performance issues. i have a plugin that is used to encrypt messages sent to haraka with pgp before they are written to disk
and depending on the amount of messages being sent the performance takes a big dip
so without setting nodes=cpu
it only runs as 1 process accepting 1 email at a time?
also when setting "nodes=cpus" does the "cpus" have to equal the number of CPU cores available
or is that auto detected
nevermind read the manual
nedry__ joined the channel
nedry_ has quit
baudehlo
The problem is that running pgp is a matter of shelling out.
that's never going to scale well.
d4rkmatter
well there doesn't really appear to be another way to encrypt emails before writing them to disk
the server running the code is quite beefy (24 cores) so i wouldnt be surprised if running haraka in clustering mode would improve performance
baudehlo
Oh for sure.
You may also want to increase the number of threads node uses.
That's the UV_THREADPOOL_SIZE setting.
d4rkmatter
ok
ill take a look at that
it doesn't appear as if the actual encryption process is slowing down the server (the CPU in use is more than capable of doing that) but only being able to process 1 message at a time which causes a backlgo
baudehlo
Yeah even that sounds unusual though. What are you using for testing?
d4rkmatter
for testing? pretty much a copy of the server but that is scaled down
but i might just test these changes out on a single prod node as i doubt it would cause any negative impact