Clustering
Clustering
As hMailServer 5 will most likely have some kind of support for clustering, it would be interested to hear what you would expect from it.
My view is that it should be possible to run hMailServer on a couple of computers in the same network. From the users point of view, it should not matter which server you access - you should be able to receive and send email just as normal. For incoming email, you could specify all the 4 servers as MX records in your DNS and use round-robin to balance the load on the hMailServer servers.
Perhaps this could be accomplished by simply removing some parts of the the caching in hMailServer. This way say 4 hMailServer servers could access the same database and file area. (The database server could be clustered as well to avoid a single point of failure).
My view is that it should be possible to run hMailServer on a couple of computers in the same network. From the users point of view, it should not matter which server you access - you should be able to receive and send email just as normal. For incoming email, you could specify all the 4 servers as MX records in your DNS and use round-robin to balance the load on the hMailServer servers.
Perhaps this could be accomplished by simply removing some parts of the the caching in hMailServer. This way say 4 hMailServer servers could access the same database and file area. (The database server could be clustered as well to avoid a single point of failure).
Re: Clustering
And what happens to the data directories ?martin wrote:The database server could be clustered as well to avoid a single point of failure.
My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)
Well that's what I was thinking, what happens if A receives a message, it stores data in database (wich is common to A and B) and then A stores the message in data directory ? Data directory is in the database server wich is visible to both ? Or will each server have it's own data directory and A will update the others data directory with an inter-server comunication (sounds redundant but...)?^DooM^ wrote:If the server is clustered with others then the data directory will be on every server.
I think I would prefer to have data where database was stored, but any comments are welcome

My perfect combination:
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)
hMailServer 5.6.1 (B2208), ASSP 1.3.3.8 (antispam), Clamav 0.98.6 (antivirus)
I suppose another way to do it would be each server has their own data directory but share the same/clustered database. When any hmail server in the group is accessed it checks the database for any new messages. hmail then checks the database to find out on which server the relating .eml file is located. hmail could then either copy the .eml file to a temp directory of its own over the network to allow a user to download it or possibly shunt them over to the mailserver that has the email message.
If you had a lot of emails though that could be very resource hungry bouncing a user between email servers.
A central storage would be ok but that brings back a single point of failure unless hmail had the capabilities to copy the .eml files to more than one location over the network upon receiving an email. hmail would have to remove the .eml from both places as well though upon the end user receiving the email too.
A tricky thing to implement without having some sort of mirroring going on between servers.
If you had a lot of emails though that could be very resource hungry bouncing a user between email servers.
A central storage would be ok but that brings back a single point of failure unless hmail had the capabilities to copy the .eml files to more than one location over the network upon receiving an email. hmail would have to remove the .eml from both places as well though upon the end user receiving the email too.
A tricky thing to implement without having some sort of mirroring going on between servers.
Agreed but i was thinking on a smaller scale where some users/companies have no idea or don't want to invest in setting up a raid configuration.
I guess its finding a balance within hmail to allow failover for joe bloggs who runs his personal mailserver for himself and his friends and adding the functionality for major companies who have the time/skill and resourses to setup raid configs.
Just my feelings on it
I guess its finding a balance within hmail to allow failover for joe bloggs who runs his personal mailserver for himself and his friends and adding the functionality for major companies who have the time/skill and resourses to setup raid configs.
Just my feelings on it

im not sure if this is possible, but what about setting up a list of delivery locations on each server. that way if you don't wnat to enable clustering you can have the file sent to the other servers when received by one. in this setup i would recomend using a second nic & have the ability to tell hms to use x ip or x nic
I agree its a good idea but you are thinking for big companies like your own.
Maybe Martin could add all 3 functionalities.
1) proper clustering support (stacks of users big companies)
2) Simple clustering with 2 nics (for medium usage and smaller companies)
3) 'Just copy the damn file' support (for billy onemate with his pc and his laptop)
That way you keep hmail viable for everyone
Maybe Martin could add all 3 functionalities.
1) proper clustering support (stacks of users big companies)
2) Simple clustering with 2 nics (for medium usage and smaller companies)
3) 'Just copy the damn file' support (for billy onemate with his pc and his laptop)
That way you keep hmail viable for everyone

-
- New user
- Posts: 3
- Joined: 2006-10-06 18:21
- Location: Pennsylvania USA
- Contact:
When dealing with clustering, is it necessary to have functionality specifically created for "billy onemate" users? Clustering isn't usually a mechanism these users want, require, or have the ability to setup. Setting up a secondary MX and using a backup schedule should create the necessary redundancy for such users. Not to mention, if a "billy onemate" user desires or needs the reliability and capacity of clustering failover and load balancing features, they really aren't a "billy onemate" user anymore. The only true way to implement clustering and have it perform the actual goals desired is by using enterprise level solutions like RAID, SAN, or NAS.
When implementing a mail clustering solution, I think it would be advantageous to only focus on the enterprise level solution. This will allow the development team to focus on the best possible performance and reliability based clustering solution. If “billy onemate” wants to use a high-end mail clustering solution, they will have to evolve their hardware to support such a solution. However, allowing users to select a wide range of data store and or SQL server technology and the locations of these servers should leave room for low cost implementations. Moving the message store to the same machine as the SQL server would effectively release the front end app from the binds of the data store. You could then create multiple front end servers connecting to a shared backend data store. It would be the job of Hmail, in this case, to manage disk access for the shared data store. Preventing other front end cluster members from accessing the same files at the same time is important. Some type of temporary flag file or file renaming should work. The data access mechanism simply needs to check for this flag file or naming convention. If it is there, it doesn’t access the file, but rather waits and retries after some random time frame. If the redundancy of a data store is not controlled by the data store hardware (RAID, mirroring, etc) then hmail could also give this feature. Users could point hmail to two separate hard drives, and hmail would perform multiple writes to each drive as changes to the data occur. A Sync process could also run that reconciles the changes and verifies the integrity of multiple drives at a configurable rate. From what I can tell, the only real obstacle that stands in the way of making Hmail cluster compatible is moving the data store from the individual servers to a shared back end or creating the extra write process to update a second, third, or tenth mirrored data store when one of the cluster members receives some activity. These additional write processes could, as mentioned before, occur on a second NIC or “internal” network making an hmail controlled mirrored data store not just for redundancy, but for increasing performance too. In all clustered environments, it seems you will need a shared SQL server. This could be of any configuration the admin desires. SQL clustering is well documented and supported. Pointing hmail to a remote SQL server isn’t hard. Maybe creating a mechanism to hang the SQL off of one NIC and the data store off of another may prove beneficial. 10.10.10.50 = data store NIC, 10.10.10.55 = SQL NIC, hmail then creates the routes to push all data traffic out the data store NIC and all the SQL traffic out the SQL NIC. This is in a pure TCP/IP environment. iSCSI, Fibre channel, or other form factors could be implemented.
When implementing a mail clustering solution, I think it would be advantageous to only focus on the enterprise level solution. This will allow the development team to focus on the best possible performance and reliability based clustering solution. If “billy onemate” wants to use a high-end mail clustering solution, they will have to evolve their hardware to support such a solution. However, allowing users to select a wide range of data store and or SQL server technology and the locations of these servers should leave room for low cost implementations. Moving the message store to the same machine as the SQL server would effectively release the front end app from the binds of the data store. You could then create multiple front end servers connecting to a shared backend data store. It would be the job of Hmail, in this case, to manage disk access for the shared data store. Preventing other front end cluster members from accessing the same files at the same time is important. Some type of temporary flag file or file renaming should work. The data access mechanism simply needs to check for this flag file or naming convention. If it is there, it doesn’t access the file, but rather waits and retries after some random time frame. If the redundancy of a data store is not controlled by the data store hardware (RAID, mirroring, etc) then hmail could also give this feature. Users could point hmail to two separate hard drives, and hmail would perform multiple writes to each drive as changes to the data occur. A Sync process could also run that reconciles the changes and verifies the integrity of multiple drives at a configurable rate. From what I can tell, the only real obstacle that stands in the way of making Hmail cluster compatible is moving the data store from the individual servers to a shared back end or creating the extra write process to update a second, third, or tenth mirrored data store when one of the cluster members receives some activity. These additional write processes could, as mentioned before, occur on a second NIC or “internal” network making an hmail controlled mirrored data store not just for redundancy, but for increasing performance too. In all clustered environments, it seems you will need a shared SQL server. This could be of any configuration the admin desires. SQL clustering is well documented and supported. Pointing hmail to a remote SQL server isn’t hard. Maybe creating a mechanism to hang the SQL off of one NIC and the data store off of another may prove beneficial. 10.10.10.50 = data store NIC, 10.10.10.55 = SQL NIC, hmail then creates the routes to push all data traffic out the data store NIC and all the SQL traffic out the SQL NIC. This is in a pure TCP/IP environment. iSCSI, Fibre channel, or other form factors could be implemented.
-
- New user
- Posts: 3
- Joined: 2006-10-06 18:21
- Location: Pennsylvania USA
- Contact:
-
- New user
- Posts: 3
- Joined: 2006-10-06 18:21
- Location: Pennsylvania USA
- Contact:
-
- Senior user
- Posts: 886
- Joined: 2005-11-28 11:43
Native support for clustering would be great, I think it needs to have the option to use a shared file space, and a 2nd option to maintain files on each server, mail should be copied to the other's shortly after delivery - should a message be requested which isn't yet copied over, then it is copied on-demand; the db would track which servers each message exists on .... maybe some options to not keep N copies of old/archived/large emails ... but otherwise seems to be the ideal way of achieving 100% uptime and true load balancing.
Yeah. I'm still thinking on how to implement interaction between different servers running in a cluster. I'm leaning towards using web services for the communication between the servers.
If the file server and database server is shared, this isn't neccessary. But if the two servers are supposed to be able to hand messages to eachother I think something like web services is needed.
If the file server and database server is shared, this isn't neccessary. But if the two servers are supposed to be able to hand messages to eachother I think something like web services is needed.
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
Clustering serves two very different purposes: increased reliability (active-passive, failover) and increased performance (active-active, load-balancing). We're talking about several components here, and each has its different needs which should also be addressed differently. Investing time and effort into something that won't be used is a waste.
- the "database" server, which is already separated from hMailServer, should be easy to cluster (active-passive). The database server should not be a bottleneck. Performance issues should be addressed through database tuning and better hardware.
- the "storage" server, where email messages are stored, is currently a local filesystem. Allowing it to be a remote filesystem via a share (which is easily clustered) should imply little effort. Similar to the database, it would be a single repository, active-passive cluster. With adequate hardware redundancy (RAID), clustering could be skipped altogether. Performance issues should be addressed through database tuning and better hardware. With time, this fileserver-based repository may evolve into something more refined (like a distributed message-based repository). However, my opinion is that, until the need of such beast is clearly shown to exist, replication should not be integrated into hMailServer, as there are already lots of different ways to do that (some synchronous, some asynchronous); it would be reinventing the wheel and making the solution unnecessarily complex.
- the "SMTP" server is part of hMailServer. MX records already provide a simple active-passive failover mechanism, alleviating the need of clustering. I can't imagine hMailServer running on an environment where adequate hardware can't solve performance problems, so I see no need for a complex active-active SMTP cluster solution to be implemented.
However, an active-passive cluster should be feasible, for cases when several public IPs are not available.
- the "POP3/IMAP" is also part of hMailServer, and IMAP server is a resource hog. It definitely needs clustering - active-active if possible - which would provide both redundancy and load-balancing.
- active-active clusters of webmail servers could also be implemented on their own machines, interacting with the SMTP and POP3/IMAP servers.
With functionality comes complexity, and the installer should be made smarter, allowing several install types (maybe something like "single server", "dual server", "multiple server").
The services should also be easy to migrate from server to server, eventually at install time, with server configuration residing on a central location - maybe on the database.
Just my €0.02 ... Ok, I may have exceeded it a bit...
Paulo
- the "database" server, which is already separated from hMailServer, should be easy to cluster (active-passive). The database server should not be a bottleneck. Performance issues should be addressed through database tuning and better hardware.
- the "storage" server, where email messages are stored, is currently a local filesystem. Allowing it to be a remote filesystem via a share (which is easily clustered) should imply little effort. Similar to the database, it would be a single repository, active-passive cluster. With adequate hardware redundancy (RAID), clustering could be skipped altogether. Performance issues should be addressed through database tuning and better hardware. With time, this fileserver-based repository may evolve into something more refined (like a distributed message-based repository). However, my opinion is that, until the need of such beast is clearly shown to exist, replication should not be integrated into hMailServer, as there are already lots of different ways to do that (some synchronous, some asynchronous); it would be reinventing the wheel and making the solution unnecessarily complex.
- the "SMTP" server is part of hMailServer. MX records already provide a simple active-passive failover mechanism, alleviating the need of clustering. I can't imagine hMailServer running on an environment where adequate hardware can't solve performance problems, so I see no need for a complex active-active SMTP cluster solution to be implemented.
However, an active-passive cluster should be feasible, for cases when several public IPs are not available.
- the "POP3/IMAP" is also part of hMailServer, and IMAP server is a resource hog. It definitely needs clustering - active-active if possible - which would provide both redundancy and load-balancing.
- active-active clusters of webmail servers could also be implemented on their own machines, interacting with the SMTP and POP3/IMAP servers.
With functionality comes complexity, and the installer should be made smarter, allowing several install types (maybe something like "single server", "dual server", "multiple server").
The services should also be easy to migrate from server to server, eventually at install time, with server configuration residing on a central location - maybe on the database.
Just my €0.02 ... Ok, I may have exceeded it a bit...

Paulo
-
- Senior user
- Posts: 886
- Joined: 2005-11-28 11:43
The XML processing overhead of web services will dent the perfomance ... but they are a very flexible and interoperable choice .... I think that for hMail -> hMail communication an optimised binary protocol would be prefered ..... though XML web services would be easier for multi-site synchronisation.
I'm thinking that the overhead of putting emails into database is going to be worthwhile to simplify the hMail clustering architecture.
Thing is, can we truely cluster MySQL without buying the commercial versions?
I'm thinking that the overhead of putting emails into database is going to be worthwhile to simplify the hMail clustering architecture.
Thing is, can we truely cluster MySQL without buying the commercial versions?
Paulo Meireles wrote: I can't imagine hMailServer running on an environment where adequate hardware can't solve performance problems, so I see no need for a complex active-active SMTP cluster solution to be implemented.
Why could you not envision an environment where adequate hardware wouldn't solve the problem? How many domains/email accounts do you think it would take to overwhelm a high end server?
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
My quote above is specific to the SMTP service. I believe hMailServer - running just SMTP, with other functionality (POP3/IMAP/storage) on other servers - is still not ready to run email servers that would choke a 4-way quad-core server (16 cores) with two bonds of four gigabit NICs each, one bond for SMTP and the other connected to the message storage. When time comes, if hMailServer reaches that (very narrow) market, I bet Martin will have contracted a horde of programmers to help him do whatever is needed to achieve it... 
Paulo

Paulo
-
- Senior user
- Posts: 886
- Joined: 2005-11-28 11:43
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
I absolutely agree with you. However, it seems I wasn't very clear earlier, so here's my rationale:CraigHarris wrote:I'd much rather have a cluster of 4 cheap servers than 1 damn expensive server.
After splitting hMailServer into several self-contained services, we can run the same workload (whichever it is) on several lower-end servers instead of a big server. The next step - providing redundancy for each of these services - can now be taken by treating each service differently, according to its own needs.
As a pure SMTP server does not store messages - it relies on another server to do it - its potencial bottlenecks are CPU and network I/O. Having two or three SMTP servers for redundancy, and relying on MX records for failover, is essencially an active-passive cluster, where only one server will be receiving SMTP traffic in any given moment, which does not provide load-balancing.
If an hypothetical low-end SMTP server cannot cope with all your SMTP traffic (which would be astounding), my guess is that it would be better/cheaper to upgrade the hardware before implementing stuff like active-active SMTP clusters, which is not trivial.
My ultimate argument is that a low-end server today is so powerful that it can cope with an enormous amount of email, so if you get more email than you can process with a low-end server - and you can pay for all that bandwidth - I'm sure you have enough money to invest on some decent servers.

Paulo
Minor note: This probably depends on where you live. Here in Sweden my 100Mbit (duplex) internet connection costs $25 / month. The bandwidth is much cheaper than the hardware required to fill it..and you can pay for all that bandwidth - I'm sure you have enough money to invest on some decent servers.
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
Ok... got your point now. I'm paying 40€/month for a 2Mbit/s ADSL line with no traffic limits.martin wrote:Minor note: This probably depends on where you live. Here in Sweden my 100Mbit (duplex) internet connection costs $25 / month. The bandwidth is much cheaper than the hardware required to fill it..and you can pay for all that bandwidth - I'm sure you have enough money to invest on some decent servers.


Even then, any dual-core machine should allow wirespeed SMTP service on a 100MBit/s interface. And if you get this kind of traffic, you'll need to store it somewhere; but I digress. You all got my point by now, and I'm sure everyone has a calculator...

Paulo
Last edited by Paulo Meireles on 2006-10-21 19:12, edited 1 time in total.
-
- Senior user
- Posts: 886
- Joined: 2005-11-28 11:43
My home connection in the UK is 7MBit downstream, 380KBit upstream for £35 a month.
My main web/mail server is also in the UK, but it's on a 100MBit full duplex connection in a datacentre and 2 terrabytes a month of bandwidth costs £45 ... I intend to have a cluster in that datacentre within a year .... backup MX records will continue to go to a US-based server which then forwards them to my UK servers when it can.
Now, ideally I need the hMail instances running on each of those to keep synchronised with each other ... this isn't yet possible, but something I'm hopeing to do in the future --- the nearest I get at the moment is by running scheduled IMAPCopy's --- but that's very inefficient.
My main web/mail server is also in the UK, but it's on a 100MBit full duplex connection in a datacentre and 2 terrabytes a month of bandwidth costs £45 ... I intend to have a cluster in that datacentre within a year .... backup MX records will continue to go to a US-based server which then forwards them to my UK servers when it can.
Now, ideally I need the hMail instances running on each of those to keep synchronised with each other ... this isn't yet possible, but something I'm hopeing to do in the future --- the nearest I get at the moment is by running scheduled IMAPCopy's --- but that's very inefficient.
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
I'm talking strictly about the SMTP service, assuming that it runs alone on a server and that it stores the messages on some other server (what I called the "storage server"), not locally as it is now. If that other server cannot cope with the traffic, the bottleneck is not the SMTP server, and this was my point from the beginning: as I see it, it's much more likely that the whole email system's bottleneck to be the storage component than the SMTP servers; that's why I said I could hardly conceive a system where the SMTP server itself would be overloaded.martin wrote:It could? That must be assuming that you have good disks. My dual-core computer starts to lag down when I create several hundred files per second..Even then, any dual-core machine should allow wirespeed SMTP service on a 100MBit/s interface.
Paulo
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
If you have some money to burn, take a look at DoubleTake: http://www.sunbelt-software.com/Double-Take.cfmCraigHarris wrote:Now, ideally I need the hMail instances running on each of those to keep synchronised with each other ... this isn't yet possible, but something I'm hopeing to do in the future --- the nearest I get at the moment is by running scheduled IMAPCopy's --- but that's very inefficient.
It provides real-time file-based replication between Windows servers.
Paulo
If POP3/IMAP is made clusterable, I would probably have to spend more time if I wanted SMTP not to be clusterable compared to making it clusterable. As you say, all the SMTP-part does is to receive the email and store it on disk.
(Btw, you can already configure hMailServer to store files on a separate disk, for example a shared folder. Guess you know it but a post in this thread indicated that you didn't)
(Btw, you can already configure hMailServer to store files on a separate disk, for example a shared folder. Guess you know it but a post in this thread indicated that you didn't)
- Paulo Meireles
- Normal user
- Posts: 72
- Joined: 2005-04-16 13:09
- Location: Lisbon - Portugal
I was thinking about an active-active SMTP cluster, with all nodes sending and receiving messages simultaneously, which I suppose would be a bit invoving. Of course that, if by "clusterable" you just mean the active-passive cluster provided by MSCS, taking SMTP out of it would mean additional - and wasted - effort...martin wrote:If POP3/IMAP is made clusterable, I would probably have to spend more time if I wanted SMTP not to be clusterable compared to making it clusterable. As you say, all the SMTP-part does is to receive the email and store it on disk.
No, you're right, I didn't know about that! So, it's already possible to provide the message store some additional resilience. Pretty neat! You spoil us with features!martin wrote:(Btw, you can already configure hMailServer to store files on a separate disk, for example a shared folder. Guess you know it but a post in this thread indicated that you didn't)

Paulo
I stumbled on this file synchronizer the other day. It works on both Linux and Windows, and I believe it's open source. Might be worth looking at for ideas.
Unison File Synchronizer
Unison File Synchronizer
Hi all,
Just want some clarification to the "caching" issue in hMailserver. Picture the following scenario:
- two servers running hMailserver, both serving as MX, SMTP, POP hosts för the same domain, evenly distributed load
- they share the same data store (mail files), via network share och cluster service
- individual SQL databases, but accounts are kept in sync (push/pull) by sql-replication, virtually meaning they have the same database
As I understand from previous postings this setup could work, for SMTP and POP3 as long as IMAP isnt used? Since IMAP messages are "cached" by each server respectively? Correct? Or does it only apply when the mails are stored in the database? Any other drawbacks to this attempt at load balancing/failover setup?
Does the script event system have any issues when the data store is shared? Any chance of events being fired multiple times when temp-files (mails in delivery) are seen by both servers?
Just want some clarification to the "caching" issue in hMailserver. Picture the following scenario:
- two servers running hMailserver, both serving as MX, SMTP, POP hosts för the same domain, evenly distributed load
- they share the same data store (mail files), via network share och cluster service
- individual SQL databases, but accounts are kept in sync (push/pull) by sql-replication, virtually meaning they have the same database
As I understand from previous postings this setup could work, for SMTP and POP3 as long as IMAP isnt used? Since IMAP messages are "cached" by each server respectively? Correct? Or does it only apply when the mails are stored in the database? Any other drawbacks to this attempt at load balancing/failover setup?
Does the script event system have any issues when the data store is shared? Any chance of events being fired multiple times when temp-files (mails in delivery) are seen by both servers?
Are you kidding me ....... Here in Australia for that you would be charged many thousands of dollars per month .... I'm on a 512k/128 plan for $50 a month ..... bastardsmartin wrote:Here in Sweden my 100Mbit (duplex) internet connection costs $25 / month.



Michael
Missing Hmailserver ... Now running Debian servers
Depends on how you configure the failover and what type of clustering you're using. If you just start the secondary hMailServer service when the first one fails, you have one type of failover. And it's possible to run several parallel severs hosting the same domain but different accounts.
Hmm, I won't add it to 4.3. It wouldn't make any sense to have several different 4.3 versions out. That would just be extremely confusing.
Do you actually need this functionality or are you just guessing? Clustering for example? Are you sure that the performance of one hMailServer server isn't enough? There's a lot of users hosting thousands of accounts on a single server and that works fine.
As for 4.4, I don't give any dates since I'll probably just break them anyway, but the features have been implemented. The remaining things are adding workarounds to avoid Outlook issues and testing.
Hmm, I won't add it to 4.3. It wouldn't make any sense to have several different 4.3 versions out. That would just be extremely confusing.
Do you actually need this functionality or are you just guessing? Clustering for example? Are you sure that the performance of one hMailServer server isn't enough? There's a lot of users hosting thousands of accounts on a single server and that works fine.
As for 4.4, I don't give any dates since I'll probably just break them anyway, but the features have been implemented. The remaining things are adding workarounds to avoid Outlook issues and testing.
Hi Martin,
As far as performance is concerned I havent tested the absolute limits of a single hMailServer instance but so far im really impressed and im sure that if you throw in enough hardware the performance will not be an issue. What Im after is some form of redundancy/failover where one could make an MX-farm and be able to add X number of servers as load increases. And also, as far as possible, eliminate single points of failure. The system im maintaining currently has over ten thousand accounts, so both performance and failover are crucial.
ATM the POP/IMAP list caching seems to be the only obstacle to being able to achieve this kind of setup.
Its really nice to hear that this feature has already been implemented! Would it be possible to try this any time soon? Maybe an alpha? If its only down to the "IMAP idle" issue its okay with me since im currently only interested in SMTP/POP.
As far as performance is concerned I havent tested the absolute limits of a single hMailServer instance but so far im really impressed and im sure that if you throw in enough hardware the performance will not be an issue. What Im after is some form of redundancy/failover where one could make an MX-farm and be able to add X number of servers as load increases. And also, as far as possible, eliminate single points of failure. The system im maintaining currently has over ten thousand accounts, so both performance and failover are crucial.
ATM the POP/IMAP list caching seems to be the only obstacle to being able to achieve this kind of setup.
Its really nice to hear that this feature has already been implemented! Would it be possible to try this any time soon? Maybe an alpha? If its only down to the "IMAP idle" issue its okay with me since im currently only interested in SMTP/POP.
Hey Nebo, You may wan't to read this post
http://www.hmailserver.com/forum/viewtopic.php?t=6193
It won't help with clustering but it shows just how versatile hmail is under heavy load.
http://www.hmailserver.com/forum/viewtopic.php?t=6193
It won't help with clustering but it shows just how versatile hmail is under heavy load.
-
- New user
- Posts: 13
- Joined: 2021-11-05 11:43
Re: Clustering
Hi,
My solution (untested) for an hMailServer cluster within the same LAN is as follows:
1. Setup a Windows server cluster using Server 2019 Data Center with 3 or more nodes
2. Setup Storage Spaces Direct across the nodes to create the cluster shared volume to be used for the data directory
3. Setup a MySQL cluster across the nodes for the hMailServer database
4. Install hMailServer on every node using the shared volume data directory and IP of the MySQL cluster for the database
Then users just point their mail clients to the IP of the server cluster which is a virtual IP and then Windows handles which node to send the request to but as each instance is accessing the same data, it doesn't matter which node your directed to and hMailServer and the user doesn't need to know and each user is effectively "bound" to whatever node they first connect with as long as that node doesn't go down during the session.
This means you only have one IP for your mail server - that of the Windows cluster. The replication and failover is handled by Windows and S2D and you have hardware and software failover. Any server goers offline and the rest take up the slack. As your using S2D rather than a simple shared folder, there are no issues with sharing permissions if 2 nodes access the same data files at exactly the same time.
If using this configuration, there's no need for hMailServer to make any updates or changes to handle clustering as Windows Server Clustering and MySQL would do the work HOWEVER, one big reason to add clustering support directly to hMailServer app would be to cluster servers at different sites or on different public IP addresses incase of an internet failure and then you would need multiple MX records in DNS and so forth but this isn't what I am trying to do in this project.
I might be wrong in my assumptions here as I haven't tested it (working on it as I write this) - by all means I welcome constructive feedback on my plans - there are likely a lot of issues I haven't taken into account - please let me know if you think of any.
My solution (untested) for an hMailServer cluster within the same LAN is as follows:
1. Setup a Windows server cluster using Server 2019 Data Center with 3 or more nodes
2. Setup Storage Spaces Direct across the nodes to create the cluster shared volume to be used for the data directory
3. Setup a MySQL cluster across the nodes for the hMailServer database
4. Install hMailServer on every node using the shared volume data directory and IP of the MySQL cluster for the database
Then users just point their mail clients to the IP of the server cluster which is a virtual IP and then Windows handles which node to send the request to but as each instance is accessing the same data, it doesn't matter which node your directed to and hMailServer and the user doesn't need to know and each user is effectively "bound" to whatever node they first connect with as long as that node doesn't go down during the session.
This means you only have one IP for your mail server - that of the Windows cluster. The replication and failover is handled by Windows and S2D and you have hardware and software failover. Any server goers offline and the rest take up the slack. As your using S2D rather than a simple shared folder, there are no issues with sharing permissions if 2 nodes access the same data files at exactly the same time.
If using this configuration, there's no need for hMailServer to make any updates or changes to handle clustering as Windows Server Clustering and MySQL would do the work HOWEVER, one big reason to add clustering support directly to hMailServer app would be to cluster servers at different sites or on different public IP addresses incase of an internet failure and then you would need multiple MX records in DNS and so forth but this isn't what I am trying to do in this project.
I might be wrong in my assumptions here as I haven't tested it (working on it as I write this) - by all means I welcome constructive feedback on my plans - there are likely a lot of issues I haven't taken into account - please let me know if you think of any.
Re: Clustering
Hi DogmanDave and Welcome to the Forum
Windows Datacenter Server with Clustering Option has a big price tag (according to this (https://www.microsoft.com/en-us/windows-server/pricing)
It's roughly $6,155 per 1 Windows Server Datacenter License (Standard $1069 and Essential $501). So if you setup 3 Datacenter Boxes or VM's
if will cost you 18.465 US Dollars (or the equivalent in your local currency). MySQL Cluster can be used without costs.
To solve the issue you have to click away any of the Warnings or you have to setup a valid SSL-Certificate for your hMailServer from a Certificate Company your EMail
Clients trust (Trusted Root Authority). This can be for example let's encrypt (no costs) or a cheap or expansive SSL-Certificate from a Third party. so your Email Client's
doesn't show Warnings to the User. So, you need a DNS-Server running, map your ip address to your mx record, to your imap and/or pop3 DNS A records. You also
maybe want to setup autodiscover / or autoconfig so Users can setup new Email accounts Office wide without Problems themselves.
Plus if the node has a failure, the Connection to the MUA (Email program the User is using) will be dropped, so there is no instant failover possible with such a configuration.
(or where ever your hMailServer Data folder is located) as plain text *.eml files. The Attachements (PDF's, JPG's etc) are encoded as Base64 binary values directly into the *.eml files.
So you have to take care to mirror the Data folder among all 3 Nodes of your configuration, which can be a bit difficult. I think the OpenSource tool Rsync can help with this Problem efficiently
PS: I you have not a lot of physical Hardware to experiment, you can use Oracle Open Source VM Tool Virtualbox which allows you to setup virtual Networks in which multiple
Virtualbox VM's can act as your nodes, should be ok for testing and experimenting.
Interesting Idea but i think this Debatte is better located in the Feature request Forum because it's not really a Development specific topic.DogmanDave wrote: ↑2022-03-12 11:46My solution (untested) for an hMailServer cluster within the same LAN is as follows:
A few thought's on this one.1. Setup a Windows server cluster using Server 2019 Data Center with 3 or more nodes
2. Setup Storage Spaces Direct across the nodes to create the cluster shared volume to be used for the data directory
3. Setup a MySQL cluster across the nodes for the hMailServer database
4. Install hMailServer on every node using the shared volume data directory and IP of the MySQL cluster for the database
Windows Datacenter Server with Clustering Option has a big price tag (according to this (https://www.microsoft.com/en-us/windows-server/pricing)
It's roughly $6,155 per 1 Windows Server Datacenter License (Standard $1069 and Essential $501). So if you setup 3 Datacenter Boxes or VM's
if will cost you 18.465 US Dollars (or the equivalent in your local currency). MySQL Cluster can be used without costs.
This isn't very practical and raises a few problems. If you run your Now day Email clients on a unencrypted Connection you will get Warnings or permanent Warnings.Then users just point their mail clients to the IP of the server cluster which is a virtual IP and then Windows handles which node to send the request to but as each instance is accessing the same data, it doesn't matter which node your directed to and hMailServer and the user doesn't need to know and each user is effectively "bound" to whatever node they first connect with as long as that node doesn't go down during the session.
To solve the issue you have to click away any of the Warnings or you have to setup a valid SSL-Certificate for your hMailServer from a Certificate Company your EMail
Clients trust (Trusted Root Authority). This can be for example let's encrypt (no costs) or a cheap or expansive SSL-Certificate from a Third party. so your Email Client's
doesn't show Warnings to the User. So, you need a DNS-Server running, map your ip address to your mx record, to your imap and/or pop3 DNS A records. You also
maybe want to setup autodiscover / or autoconfig so Users can setup new Email accounts Office wide without Problems themselves.
It can be done this way, but you have to issue the same DNS SSL/TLS Configurations for your nodes as well as if it would be if it runs in a single instance.This means you only have one IP for your mail server - that of the Windows cluster. The replication and failover is handled by Windows and S2D and you have hardware and software failover. Any server goers offline and the rest take up the slack. As your using S2D rather than a simple shared folder, there are no issues with sharing permissions if 2 nodes access the same data files at exactly the same time.
Plus if the node has a failure, the Connection to the MUA (Email program the User is using) will be dropped, so there is no instant failover possible with such a configuration.
Yeah, but you keep in mind only a portion of the Email Data hMailServer maintains is saved in the SQL-Database. The most Data are saved in C:\Program Files (x86)\hMailServer\Data\*.*If using this configuration, there's no need for hMailServer to make any updates or changes to handle clustering as Windows Server Clustering and MySQL would do the work HOWEVER, one big reason to add clustering support directly to hMailServer app would be to cluster servers at different sites or on different public IP addresses incase of an internet failure and then you would need multiple MX records in DNS and so forth but this isn't what I am trying to do in this project.
(or where ever your hMailServer Data folder is located) as plain text *.eml files. The Attachements (PDF's, JPG's etc) are encoded as Base64 binary values directly into the *.eml files.
So you have to take care to mirror the Data folder among all 3 Nodes of your configuration, which can be a bit difficult. I think the OpenSource tool Rsync can help with this Problem efficiently
PS: I you have not a lot of physical Hardware to experiment, you can use Oracle Open Source VM Tool Virtualbox which allows you to setup virtual Networks in which multiple
Virtualbox VM's can act as your nodes, should be ok for testing and experimenting.
Re: Clustering
I don't have a dog in this fight as I only run hMailserver as a store-and-forward SMTP relay for automated or user-stimulated backend processes. I do have a redundant pair (VMs on different servers), but they are not clustered as I do not need to share any data between them and I do have a load balancer farm to manage which box gets SMTP (internal-only) connections.
Datacenter is needed for Storage Spaces Direct which is not the only option for shared storage for a cluster. If you're running a production environment you probably already have a highly available, redundant storage you can leverage. If not, you're probably not a candidate for this anyway.
BTW: I've done this (hardlink folders) with a number of applications which are not generally designed for WSFC. Works great.
I've also set up a number of more 'nix'ish "clustered" applications using CARP, HSRP, VRRP. Those don't tend to be applications with a large amount of storage to share and have no "shared" data, just configuration and state synchronization.
Datacenter is not needed for Failover Clustering, just Standard. https://docs.microsoft.com/en-us/window ... erver-2022Dravion wrote: ↑2022-03-12 14:40A few thought's on this one.1. Setup a Windows server cluster using Server 2019 Data Center with 3 or more nodes
2. Setup Storage Spaces Direct across the nodes to create the cluster shared volume to be used for the data directory
3. Setup a MySQL cluster across the nodes for the hMailServer database
4. Install hMailServer on every node using the shared volume data directory and IP of the MySQL cluster for the database
Windows Datacenter Server with Clustering Option has a big price tag (according to this (https://www.microsoft.com/en-us/windows-server/pricing)
It's roughly $6,155 per 1 Windows Server Datacenter License (Standard $1069 and Essential $501). So if you setup 3 Datacenter Boxes or VM's
if will cost you 18.465 US Dollars (or the equivalent in your local currency). MySQL Cluster can be used without costs.
Datacenter is needed for Storage Spaces Direct which is not the only option for shared storage for a cluster. If you're running a production environment you probably already have a highly available, redundant storage you can leverage. If not, you're probably not a candidate for this anyway.
I've never installed hMailserver to C:\ but in a cluster I probably would, then just move the \Data (and maybe others?) folder to the shared drive (e.g. X:\hMailServer\Data) and make a hardlink from C:\Program Files\hMailServer\Data to location (e.g. X:\hMailserver\Data) How hMailserver updates work is the thing to thoroughly understand in this process.Dravion wrote: ↑2022-03-12 14:40Yeah, but you keep in mind only a portion of the Email Data hMailServer maintains is saved in the SQL-Database. The most Data are saved in C:\Program Files (x86)\hMailServer\Data\*.*If using this configuration, there's no need for hMailServer to make any updates or changes to handle clustering as Windows Server Clustering and MySQL would do the work HOWEVER, one big reason to add clustering support directly to hMailServer app would be to cluster servers at different sites or on different public IP addresses incase of an internet failure and then you would need multiple MX records in DNS and so forth but this isn't what I am trying to do in this project.
(or where ever your hMailServer Data folder is located) as plain text *.eml files. The Attachements (PDF's, JPG's etc) are encoded as Base64 binary values directly into the *.eml files.
So you have to take care to mirror the Data folder among all 3 Nodes of your configuration, which can be a bit difficult. I think the OpenSource tool Rsync can help with this Problem efficiently
BTW: I've done this (hardlink folders) with a number of applications which are not generally designed for WSFC. Works great.
I've also set up a number of more 'nix'ish "clustered" applications using CARP, HSRP, VRRP. Those don't tend to be applications with a large amount of storage to share and have no "shared" data, just configuration and state synchronization.