Performance Issues in Playback

warningEnsure that you are using the latest Sahi version.

Browser Playback becomes slow

symptom For longer runs, the playback gradually becomes slow and more scripts are aborted.
resolution Slow performance can be attributed to a variety of reasons. Below are a few known resolutions.
  1. Sahi's Auto Threading feature must be enabled by setting the below properties in userdata.properties.
    1. Ensure sahi.auto_thread.enabled property is set as true.
    2. Specify a value for sahi.threshold.cpu_usage property. The recommended value range is 70 to 90. An optimal value for this property varies per system. So run your scripts multiple times to deduce an optimal value for your system.
  2. There may be other applications running in your system which have occupied RAM. So ensure that your system has enough RAM available for playback.
  3. Chromium project based browsers employ a Background Tab Throttling feature to achieve power optimization. This feature throttles the performance of background tabs. As a consequence, this slows down the playback in background tabs. To disable this feature, follow the steps as in the examples below.
    1. In browser_types.xml, search for chrome. Add --disable-background-timer-throttling to startup options for Google Chrome.
    2. In browser_types.xml, search for msedge. Add --disable-background-timer-throttling to startup options for Microsoft Edge.
    <options>--no-default-browser-check --user-data-dir=$userDir\browser\chrome\profiles\sahi$threadNo --proxy-server=127.0.0.1:$port --disable-popup-blocking --always-authorize-plugins --allow-outdated-plugins --enable-npapi --incognito --disable-background-networking --disable-component-update --disable-renderer-backgrounding --disable-backgrounding-occluded-windows --disable-background-timer-throttling</options>
  4. For AWS instances, it is advisable to enable unlimited mode.
    1. Login to AWS Management Console.
    2. Right-click on an instance used as Sahi node.
    3. Click on Instance Settings > Change credit specification.
    4. Click on the checkbox for Enable Unlimited mode.

System becomes slow during Sahi Playback

symptom As Sahi Playback proceeds, the CPU utilization and the physical memory usage by Sahi Pro becomes very high. Also, the physical memory usage by 'Sophos Net Filter' process gradually rises. Eventually, the system becomes very slow.
causeSophos antivirus continuously monitors Sahi Pro's internal communication to the domain https://sahi.example.com. This continuous scanning increases the CPU utilization and the physical memory usage by Sahi Pro.
resolution Exclude or whitelist https://sahi.example.com in Sophos antivirus, so that it ignores this url.
info By default, sahi.common_domain property is set as sahi.example.com in userdata.properties. If any other domain is set as common domain for Sahi, whitelist that domain in Sophos antivirus.