Archive for August, 2010
Previously, iMessage.to kept all the about to be sent and sent messages in a common message pool. The only thing that differentiates between these 2 types of messages is a STATUS FLAG.
Previous Architecture : Message Pool comprises of both Sent and About to be Sent Messages
Well, this architecture worked fine when the amount of messages in the pool are small. But as the messages accumulate to the millions… the Email Sending Thread started to encounter performance issues. To sieve out the messages to be sent amidst a mountain load of messages in a pool consumed virtually 100% of a server’s CPU.
It was time for an architecture revision. For a start, we decided to split the messages into 2 separate pools. A MessageQueue for messages to be sent an a MessageArchive for messages that have been sent. By doing it this way, the MessageQueue will always be small in size and will allow the Email Sending Threads to retrieve the relevant messages to be dispatched quickly.
Sent messages will need to be kept in the MessageArchive to ensure that Bounce, Unsubscription, Update and Statistics Tracking operations can be performed on the dispatched email.
New Architecture : The messages are split into separate pools for better performance
Glad that a simple architectural change has greatly improved the performance of the product!