Skip to content

How To Implement Performance Tweaking Through Logging Configuration and Logs Archiving

This page describes few configurations, which can be enabled for performance tweaking through logging configurations and logs archiving in HyWorks Controller v3.0-RC5.

Increasing Maximum Number of Records to be kept

By default, HyWorks v3.0-RC5 will keep maximum of 500000 records in its log database (which is of type SQL CE -Embedded database) and it's not recommended to increase the logs beyond this limit.

If number of records are configured for 50000, on upgrade it will be automatically changed to 500000; but if the configuration of log records has been changed then it will require change to be done manually, which can be done by following steps:

  1. Log-into HyWorks Controller Management Console using super administrator account.

  2. Go to System -> Advance Config page

  3. Locate the setting DBlog_MAXRecords and click on Edit button

  4. Update the value to 500000

  5. Click on button Update, displayed on top and bottom of the Advance Config section

  6. New settings are saved and now Controller will keep maximum of 500000 records in default embedded log db.

Note

Keep on monitoring HyWorks Controller performance and if it has been found to be degrading post logs configuration, revert to a lesser number.

Sending the Logs to SQL Server

Another configurational change can be used to use the SQL Server to store the logs, which can have following two benefits:

  • Improved Logging Performance

  • More number of records to be saved

Note

  1. This is manual process requires HyWorks Controller Service restart and should be done under the supervision of Accops Support Team

  2. Necessary backups of configuration files should be taken for faster restoring if any problematic effects are observed

  3. Configurations are required on both Controller servers if HyWorks HA is configured

Recommendation

It is recommended to install another SQL Instance for logging. Configure HyWorks Controller database and logging both on same instance could lead to performance degradation.

Configuration Steps to Change the Logs Server

Assumption

  • Another instance of SQL Server is already installed, running and accessible from HyWorks Controller server

Configuration Process

  1. Open Microsoft SQL Server Management Studio and Connect using appropriate administrator credentials to appropriate SQL Server to be configured as Log server

  2. Open a new SQL query and paste the following queries to create a new logs DB

    CREATE DATABASE LOGDB

    GO

  3. Now new database is created, run the following query to create appropriate tables in LOGDB

    USE LOGDB

    GO

    CREATE TABLE [Log] (

    [LogId] bigint IDENTITY (1,1) NOT NULL

    , [Date] datetime NOT NULL

    , [Level] nvarchar(100) NOT NULL

    , [Logger] nvarchar(100) NOT NULL

    , [Message] ntext DEFAULT NULL NULL

    , [StackTrace] ntext DEFAULT NULL NULL

    , [StackTraceDetail] ntext DEFAULT NULL NULL

    , [ORGID] nvarchar(128) NOT NULL

    , [UserName] nvarchar(128) NOT NULL

    );

    GO

    ALTER TABLE [Log] ADD CONSTRAINT [PK_Log] PRIMARY KEY ([LogId]);

    GO

  4. SQL Server is ready to be configured in HyWorks Controller.

  5. Connect to HyWorks Controller Server system using remote desktop connection or console session (if in HA, first connect to secondary HyWorks Controller server)

  6. Go to HyWorks Controller Installation location (default installation path is mentioned below)

    C:\Program Files (x86)\Accops\HyWorks\Service

  7. Locate the configuration file EDC.Service.exe.config

  8. Copy the file and paste it as some safe location for backup

  9. Download the EncryptDecryptAppConfigFile tool (Please ask the Accops support team for the download link)

  10. Copy the tool on HyWorks Controller Server installation folder, default installation path is

    C:\Program Files (x86)\Accops\HyWorks\Service

  11. Run the tool with admin privileges and browse the EDC.Service.exe file and click on button Decrypt Config

    Default Location is C:\Program Files(x86)\Accops\HyWorks\Service\EDC.Service.exe

  12. It will decrypt the EDC.Service.exe.config file for next operation

  13. Open the EDC.Service.exe.config with WordPad

  14. In ConnectionStrings section, locate the connection strings for LogsDBContext which should be like the below screenshot

  15. Replace it with the following Connection String

    <add name="LogDBContext" connectionString="Data Source=<ServerAddress or FQDN>\sqlexpress,1433;Initial Catalog=LOGDB;User ID=sa;Password=password@123;Encrypt=False;Min Pool Size=100;Max Pool Size=500;Pooling=true;TrustServerCertificate=False;MultipleActiveResultSets=true; " providerName="System.Data.SqlClient" >
    
    1. Please note the highlighted sections should be changed as per SQL Server instance configurations, the configurations are

      1. SQL Server Address

      2. SQL Server Instance Name

      3. SQL Server Static Port to be used

      4. User Id: to be used to connect to SQL Server

      5. Password: User password

  16. Save the file

  17. Run the tool with admin privileges and browse the EDC.Service.exe file and click on button Encrypt Config

    Default Location is C:\Program Files(x86)\Accops\HyWorks\Service\EDC.Service.exe

  18. Open Services (Open Run Prompt, type Services.msc and press Enter)

  19. Locate and select Accops HyWorks Controller Service and click on Restart link

  20. Accops HyWorks Controller Service will get restarted and will now start sending the logs to configured SQL Server

  21. Perform couple of activities on HyWorks Controller Management Console, go to Logs section and verify if appropriate logs entries are being created

Note

Old logs will not be moved to the new SQL Server but will remain in previous embedded logsdb, the location of the file is:

C:\Program Files (x86)\Accops\HyWorks\Service\Logs

Configuring Syslog Server in HyWorks Controller for Archiving

Assumption or Prerequisites

  1. External syslog server is installed, running and accessible from HyWorks Controller Server

Process to Configure External Syslog Server

  1. Connect to HyWorks Controller Server system using remote desktop connection or console session (if in HA, first connect to secondary HyWorks Controller server)

  2. Go to HyWorks Controller Installation location (default installation path is mentioned below)

    C:\Program Files (x86)\Accops\HyWorks\Service

  3. Locate the configuration file log4net.config

  4. Update syslog server IP and port in log4net.config

    • In log4net.config find appender with name \"RemoteSyslogAppender\"

    • Set SysLog Server`s IP address and Port as per highlighted section below in

      <appender name="RemoteSyslogAppender" type="log4net.Appender.RemoteSyslogAppender">
            <identity value="HyworksController" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="%level %property{USERNAME} %property{ORGNAME} %message %exception %property{ORG_ID} %logger" >
            </layout>
            <remoteAddress value="ServerIP" /> <!--Syslog server IP address-->
            <remotePort value="514" /><! --default port 514-->
      </appender>
      

    The section should now look like this:

  5. Enable Syslog Appender: In the log4net.config file, at the bottom, in root section -> Add following Appender xml node in \<root>

    <appender-ref ref="RemoteSyslogAppender" />
    <root>
    <level value="INFO" />
    <appender-ref ref="UdpAppender" />
    <appender-ref ref="RemoteSyslogAppender" />
    </root>
    

    The section should now look like this:

  6. Save the log4net.config file

  7. Open Services (Open Run Prompt, type Services.msc and press Enter)

  8. Locate and select Accops HyWorks Controller Service and click on Restart link

  9. Accops HyWorks Controller Service will get restarted and will now start sending the logs to configured syslog Server

Note

  • The configuration is tested with CentOS based rsyslog server

  • It requires UDP based syslog server, as the controller supports only UDP based communication with syslog server.