General discussion on installation and configuration of SOGo

Text archives Help

Re: [SOGo] Performance tuning

Chronological Thread 
  • From: "Odhiambo Washington" ( ) < >
  • To:
  • Subject: Re: [SOGo] Performance tuning
  • Date: Fri, 1 Mar 2019 19:39:49 +0300
  • Dmarc-filter: OpenDMARC Filter v1.2.0 654BB1DE5106

On Fri, 1 Mar 2019 at 14:36, Lorenz Pressler < > wrote:

I am a quite new SOGo user and testing it on my mail server. So far I am
very pleased but I am still struggling to improve performance on the web

Hardware is a Xeon E3 with 32 GB RAM
Systemdisk is an SSD (ZFS)
Mails are located on an HDD (ZFS)

Server runs only dovecot + postfix + rspamd + nginx + redis + memcached
+ mariadb (+ sogo)
OS: Freebsd 11.2
whole mail infrastructure with sogo runs in a jail with a nginx reverse
proxy infront.
access via IMAP (e.g. thunderbird) is fast.

Viewing a mail in the SOGo webmail interface however takes > 1s which
makes it bothersome to use (from the click on the message in the message
list to viewing the mail content in the message pane). I enabled a few
debug options in the conf and the log is showing me eg:

 > Mar 01 11:47:42 sogod [49882]: |SOGo| starting method 'POST' on uri
'/SOGo/so/ /Mail/unseenCount'
 > Mar 01 11:47:43 sogod [49882]: |SOGo| request took 1.591988 seconds
to execute

I don't have much in my config at all, maybe I am missing something; I
just set the Workers count to 6, with the standard 1 I got 502 errors
from my proxys very often. I'd be thankful for any more input how to
pinpoint what's slowing down these requests and how to speed them up.

   /* Database configuration (mysql:// or postgresql://) */
   SOGoProfileURL = "mysql:*****";
   OCSFolderInfoURL = "mysql:*****";
   OCSSessionsFolderURL = "mysql:*****";

   /* Mail */
   SOGoDraftsFolderName = Drafts;
   SOGoSentFolderName = Sent;
   SOGoTrashFolderName = Trash;
   SOGoJunkFolderName = Spam;
   SOGoIMAPServer =;
   SOGoSieveServer = sieve://;
   SOGoSMTPServer =;
   SOGoMailDomain = mydomain.tld;
   SOGoMailingMechanism = smtp;
   //SOGoForceExternalLoginWithEmail = NO;
   //SOGoMailSpoolPath = /var/spool/sogo;
   NGImap4ConnectionStringSeparator = "/";

   /* Authentication */
   SOGoPasswordChangeEnabled = YES;

   SOGoUserSources =
         type = sql;
         id = users;
         viewURL = "mysql://****";
         canAuthenticate = YES;
         isAddressBook = NO;
         userPasswordAlgorithm = sha;
         MailFieldNames = ( aliases );

   /* Web Interface */
   SOGoPageTitle = webmail.mydomain.tld;
   SOGoVacationEnabled = YES;
   SOGoForwardEnabled = YES;
   SOGoSieveScriptsEnabled = YES;
   //SOGoMailAuxiliaryUserAccountsEnabled = YES;
   //SOGoTrustProxyAuthentication = NO;
   //SOGoXSRFValidationEnabled = YES;

   /* General - SOGoTimeZone *MUST* be defined */
   SOGoLanguage = English;
   SOGoTimeZone = Europe/Vienna;
   //SOGoCalendarDefaultRoles = (
   //  PublicDAndTViewer,
   //  ConfidentialDAndTViewer
   //SOGoSuperUsernames = (sogo1, sogo2); // This is an array - keep the
   //SxVMemLimit = 384;
   //WOPidFile = "/var/run/sogo/";
   //SOGoMemcachedHost = "/var/run/memcached.sock";

   WOWorkersCount = 6;

   /* Debug */
   SOGoDebugRequests = YES;
   SoDebugBaseURL = YES;
   ImapDebugEnabled = YES;
   //LDAPDebugEnabled = YES;
   //PGDebugEnabled = YES;
   MySQL4DebugEnabled = YES;
   SOGoUIxDebugEnabled = YES;
   //WODontZipResponse = YES;
   WOLogFile = /var/log/sogo/sogo.log;

Lorenz Pressler

It's only yesterday that I was thinking of asking the exact question: How to improve the performance of SOGo.
I also run FreeBSD-11.2 and it's really only myself using SOGo webmail on the server. I have just a few e-mails -
24 to be exact.
And the behaviour when loading an e-mail is exactly as described by Lorenz.
At some point I was tempted to look at the config for memcached, but that doesn't exist in FreeBSD. You have to use
the memcached_flags.
So, what I am going to do is to see whether starting memcached with "-m NN' (where MM is MBs of RAM) would improve
the response, seeing as there is not much to change in this aspect.

On my Ubuntu server (identical setup to my FreeBSD Server), the response is quite acceptable and looking at how memcached is run, I see:

wash@lists:~$ ps ax | grep memca
  807 ?        Ssl    0:20 /usr/bin/memcached -m 64 -p 11211 -u memcache -l -P /var/run/memcached/

So, a suggestion for Lorez: Let's play with "-m 64" in the memcached_flags and see if that changes the experience.
With the huge RAM that you have, perhaps you can even feed it more, but then again, it might not change much, because of
the explanation I see in a typical memcached.conf in Linux (which we can borrow our memcached_flags from is below.
On Linux, the default is "-m 64".

We compare notes after :-) 

# memcached default config file
# 2003 - Jay Bonci <
# This configuration file is read by the start-memcached script provided as
# part of the Debian GNU/Linux distribution.

# Run memcached as a daemon. This command is implied, and is not needed for the
# daemon to run. See the README.Debian that comes with this package for more
# information.

# Log memcached's output to /var/log/memcached
logfile /var/log/memcached.log

# Be verbose
# -v

# Be even more verbose (print client commands as well)
# -vv

# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default
# Note that the daemon will grow to this size, but does not start out holding this much
# memory
-m 64

# Default connection port is 11211
-p 11211

# Run the daemon as root. The start-memcached will default to running as root if no
# -u command is present in this config file
-u nobody

# Specify which IP address to listen on. The default is to listen on all IP addresses
# This parameter is one of the only security measures that memcached has, so make sure
# it's listening on a firewalled interface.

# Limit the number of simultaneous incoming connections. The daemon default is 1024
# -c 1024

# Lock down all paged memory. Consult with the README and homepage before you do this
# -k

# Return error when memory is exhausted (rather than removing items)
# -M

# Maximize core file limit
# -r

Best regards,
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", grep ^[^#] :-)

Archive powered by MHonArc 2.6.18.

Top of page