Skip to content

Commit

Permalink
WIP Net::SMTPServer: switch from PreForkSimple to PreFork
Browse files Browse the repository at this point in the history
spawns fewer fakesmtpd processes when they're not actually being used

XXX maybe we even want Fork rather than PreFork, need to do some
more testing...
  • Loading branch information
elliefm committed Aug 21, 2024
1 parent dbb63d0 commit dd79a68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cassandane/Cassandane/Net/SMTPServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ use warnings;
use Data::Dumper;
use File::Spec::Functions qw(catfile);
use File::Temp qw(mkstemps);
use Net::Server::PreForkSimple;
use Net::Server::PreFork;

use lib ".";
use Net::XmtpServer;
use Cassandane::Util::Log;
use Cassandane::Util::Slurp;
use JSON;

use base qw(Net::XmtpServer Net::Server::PreForkSimple);
use base qw(Net::XmtpServer Net::Server::PreFork);

sub new {
my ($class, $params, @args) = @_;
Expand Down
3 changes: 2 additions & 1 deletion cassandane/utils/fakesmtpd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ my $smtpd = Cassandane::Net::SMTPServer->new({
xmtp_personality => 'smtp',
host => $host,
port => $port,
max_servers => 3, # default is 50, yikes
min_servers => 1,
min_spare_servers => 0, # XXX not sure this has any useful effect vs 1
control_file => "$basedir/conf/smtpd.json",
xmtp_tmp_dir => "$basedir/tmp/",
store_msg => 1,
Expand Down

0 comments on commit dd79a68

Please sign in to comment.