Here at Zen Software, we love the fact MailStore is such a versatile animal, able to work with most mail platforms and the vast majority of requirements users throw at it. However, if you’ve got a large mail server running multiple jobs, or lots of hosted mail accounts, for example, it’s possible at some point that you could find yourself pushing the limits of your hardware or bandwidth.
Optimising it isn’t difficult and largely boils down to how fast and how often you need your new email added to the archive. The temptation when setting it up for the first time is to opt for the ‘as fast as possible’ approach, when in reality you may be hammering your resources unnecessarily.
In this post, I’ll look at that and provide some simple tips for optimising your MailStore installation around your business needs.
1) Use the job monitor Luke
The best way to understand what’s happening in MailStore is to look out how often jobs are running, how long they’re taking and particularly if you’re seeing any overlap. This is where the jobs monitor comes in, and it’s this that you’ll need to keep referring back to as you make adjustments.
Another way to check the load, of course, is via Windows Task Manager, where you can look at both the memory and CPU usage of the MailStoreServer.exe / MailStoreServer_x64.exe process.
On busy servers where you’re running multiple threads (see Threads section below), the memory usage can become high without your realising, and this is the indication you’re looking for that you need to reduce the number running simultaneously.
2) Avoid over-using ‘automatic’ mode
Automatic mode was introduced in version 9 of MailStore and essentially runs a job, waits for a period of 5 minutes (you can adjust this) and then runs it again.
If the job only takes a few seconds to run then you’re only repeating a small amount of activity every 5 minutes.
In contrast, if you’re running a multiple user mailbox job that’s synchronising a large number of users, it could take 15 minutes and then only be idle for 5 mins before starting over. meaning for 75% of your day, the server’s working fairly hard.
This isn’t ideal as for 75% of your day, your server’s working hard. You can increase that waiting period but it quickly gets to the point where you’re better off using scheduled jobs as described below.
Automatic mode starts when your server does
A final point about on automatic jobs is that they all start with the MailStore service. So If you reboot, or even start the service, all of a sudden you’ll be putting maximum load on the server and network etc. which can be significant for large deployments.
3) Think about using a scheduled job
The job scheduler in MailStore is often overlooked because it’s normally not archiving as frequently as in automatic mode. But if your automatic job is taking more than 15 minutes, it’s something you should consider.
This is ultimately a business decision around how quickly you need an email to be in the archive. It’s still in the mailbox of course, so if you can live with the fact that a new message will only be searchable in the archive after say 30 mins or an hour, rather than instantly, that’s a lot of load you’re saving.
With scheduled jobs, you simply choose to run them the set interval that works for you, be it every X minutes, days, weeks, months.
Whatever job you’ve configured, I recommend you name your jobs clearly so it’s easy to tell whether it’s an automatic, manual or scheduled one.
4) Use the right number of ‘threads’
In my experience, when we see a MailStore server slowdown, it’s usually as result of there being too many active threads in progress.
This is particularly relevant if you’re using a ‘multiple mailbox’ job, where server mailboxes can be accessed simultaneously. The default for these types of jobs is 5 threads but if you have multiple jobs connecting to multiple mailboxes you can quickly have many overlapping jobs taking up many more threads. Each thread will reserve Memory so if you notice your Mailstore Server process is taking up a large amount of memory the chances are that you have many threads running at once.
The default for these types of jobs is 5 threads, but if you have multiple jobs connecting to multiple mailboxes you can quickly have many overlapping jobs which start to use even more threads.Each thread will reserve Memory so if you notice your Mailstore Server process is taking up a large amount of memory the chances are that you have many threads running at once.
Each thread will reserve memory so if you notice your Mailstore Server process is taking up a large amount of memory the chances are that you have many threads running at once.
In our tests, we haven’t seen much difference in the overall archive throughput when reducing the threads, so another top tip is to reduce jobs to either one or two threads.Often a job that is archiving just one mailbox at a time actually can perform better and have less timeout as a result.
Often a job that is archiving just one mailbox at a time actually can perform better and have less of a risk of timeouts as a result.
5) Use favourite folder archiving
Another way to further optimise MailStore mailbox jobs is to focus them on specific folders within user’s mailboxes.
For example, you may have a job that synchronises a user’s full folder structure every 15 minutes and then deletes all emails older than 1 year. In order to do this, MailStore needs to check each folder for changes. If it sees a change it will then poll that folder’s contents.
If MailStore detects a change in a folder, it polls the contents, so you can further optimise tasks by only archiving specific folders of interest such as the ‘Inbox’ and ‘Sent Items’.
Incorporate a ‘mop up’ job
Instead of having MailStore perform the same tasks over and over, by using a ‘mop-up’ job as I’m going to call it, you can do things like folder synchronisation and the purging of old email from mailboxes once, at a specific time out of hours.
That’s it for now – please let me know in the comments if you’re not sure about anything I’ve covered or if you have other suggestions that might be useful. Hopefully, these tips will help you get the most out of your MailStore server and keep it running beautifully smoothly for many years to come!