Optimizing Settings of Web Module
Posted by on 12 April 2013 05:02 AM

When should I Use this Tweak?

If your WebClient suffers from stability issues such as red-bars that read "connection lost", performance issues with timeouts caused by a huge PHP load or occasional Web module restarts, then it is probably time to review the Web server settings. The settings are accessible through the IceWarp Server Administration console. Tweaking settings can bring a huge performance and stability increase.

Web Settings

There are several places in the iceWarp Server Administration console where the related options are stored. First, navigate to the Web node and double-click the defined website in the General tab. Go to the Scripting tab and make sure all listed services are set to (fastcgi);php\php.exe. The first line, which is responsible for instant messaging, remains unchanged.

 a

This means that instead of using ISAP (the default for version 9 and older) now we use FastCGI which is more powerful and runs PHP as a single process. It increases the stability considerably because if one of the php.exe processes crashes it is immediately replaced by another php.exe process and this action does not affect the stability of the Web module. The reason being is that it is not loaded as a single dll  attached to the Web module and runs separately from now on.

Webserver.dat

The next step is to optimize some values in the webserver.dat file. You do not need to do this if you are running a fresh installation of version 10.3.x and higher as these values are already optimized. Incorrect values might appear with continuously upgraded installations of the IceWarp Server, this is because this file is not overwritten by these upgrades.

Go to the Web node and click Edit File located at the bottom of the General tab.

 There are just few values we are interested in:

<FCGI_INITSERVERS>6</FCGI_INITSERVERS>  – this variable tells us how many php.exe files should run after the Web service is started and there will never be less than six of them. Six is also the correct value for the variable.

<FCGI_THREADPOOL>15</FCGI_THREADPOOL>  – this variable tells us whatthe maximum number of running php.exe files is. After a long time of testing in different environments, we found that 15 is the best number and all the setups we tested were capable to run such a number. A higher value can be quite demanding for the system resources and is not recommended.

<MODULE TITLE="[activesync]" THREADPOOL="-1"/> – this value shows how many threads can handle the active syncs requests – in this case "-1". The value is taken from the global thread pool which is set via API console.

API Console

This is how we get to one of the most important changes, the global thread pool should be unlimited to make ActiveSync and instant messaging run smoothly. As mentioned before, this can be set via API console. The appropriate variable is c_webservice_appmaxthreads and is to be set to 0 (zero).

 

Now just restart the Web module and the tweaking is done.The correct values of webserver.dat for the main variables:

<WEB>

   <OPTIONS>

      <ISAPI_RESTART>0</ISAPI_RESTART>

      <ISAPI_RESTART500/>

      <ISAPI_RESTART500DATA/>

      <FCGI_INITSERVERS>6</FCGI_INITSERVERS>

      <FCGI_TIMEOUT>150000</FCGI_TIMEOUT>

      <FCGI_MAXSERVERS>0</FCGI_MAXSERVERS>

      <FCGI_MAXROUNDS>10000</FCGI_MAXROUNDS>

      <FCGI_RESTART500>3</FCGI_RESTART500>

      <FCGI_BINDIP>127.0.0.1</FCGI_BINDIP>

      <FCGI_CHECKRUNNING>1</FCGI_CHECKRUNNING>

      <FCGI_ENVIRONMENT>PHP_FCGI_MAX_REQUESTS=20000</FCGI_ENVIRONMENT>

      <FCGI_THREADPOOL>15</FCGI_THREADPOOL>

      <FISAPI_NUMSERVERS>3</FISAPI_NUMSERVERS>

      <FISAPI_INITSOCKS>10</FISAPI_INITSOCKS>

      <FISAPI_MAXROUNDS>10000</FISAPI_MAXROUNDS>

      <FISAPI_TIMEOUT>900000</FISAPI_TIMEOUT>

      <MODULES_TIMEOUT>

         <MODULE TITLE="[activesync]" TIMEOUT="1800000"/>

      </MODULES_TIMEOUT>

      <MODULES_THREADPOOL>

        <MODULE TITLE="[activesync]" THREADPOOL="-1"/>

      </MODULES_THREADPOOL>

      <HTTP10>0</HTTP10>

      <NOCHUNKEDENCODING>1</NOCHUNKEDENCODING>

      <COMPRESSTHRESHOLD/>

      <LOGFORMAT>c-ip cs-username date time cs-method cs-uri-stem cs-version sc-status bytes cs(Referer) cs(User-Agent)</LOGFORMAT>

(2 vote(s))
Helpful
Not helpful

Comments (0)