Zarafa: acceleration of the web services

Support for Zarafa has been present on the 1A server for years now. This alternative for Exchange is laden with functionality for email, calendars and contacts. However, this can also cause heavy load on a 1A server. Of course 1A First Alternative is constantly improving the 1A server. This time we found something that ensures that the three web services can run more smoothly.

These are WebAccess and WebApp (the two webmail programs) and Z-Push (for synchronization with mobile devices). You, as a user of Zarafa, will therefore experience far fewer delays in these three services.

Read more about Zarafa on the 1A server »

For those interested, here is a brief explanation of what we did.

Technical explanation

WebAccess, WebApp and Z-Push run on the web server of the 1A server and are written in a (web) programming language called PHP. When requesting a page, the PHP code is read, translated into machine language and the result is sent to the applicant. The result is a web page, or, in the case of Z-Push, output which is can be parsed by the program that sent the request (the mobile device).

Reading and translating PHP code is taxing on the Web server. The solution is a mechanism that is called caching: storing the result in fast RAM. However, it does not make sense to cache the complete result, because the content of pages are completely dependent on which information each applicant requests. Fortunately, parts of the result are often the same (eg. the layout), and this is where performance can be gained.

The answer is therefore to cache blocks of generated code, and to provide those in combination with the dynamic pieces. This may seem marginal, but in practice this provides a performance improvement of 20% on average!

1A has tested several of these solutions and in the end settled on Zend OPcache. Zend Technologies is the company that develops the Zend Engine, the core of PHP. Besides the fact that it is currently the fastest cache of its kind, an important factor in the selection was that Zend OPcache will be included by default from PHP 5.5, thus guaranteeing maximum interoperability.

We would not be 1A if we had not looked critically at the code and at how we can best use it. The web server on the 1A server can run numerous different web applications. This makes it very difficult to determine settings which work for all setups. Therefore, we have decided to limit usage of OPcache to the three Zarafa services. This way, we can predict exactly how much RAM should be reserved on any 1A server and still make use of the performance improvements that Zend OPcache provides. Because the Zarafa web applications will cause less load, an additional positive effect for other web applications on the 1A server is that they will also respond more quickly even though they do not utilize OPcache.


Richard de Vroede

A perfectionistic Jack-of-all-trades who dedicates all of his passion to his work.