RELEEM HELP CENTER

Documentation

Installation and Usage

Welcome to Releem

Releem is a simple MySQL tuning tool to improve database performance and reduce the costs of servers. Using Releem, you can see general Performance metrics, and it will assist you in preparing performance-optimized configurations tailored for your MySQL server based on Workload, MySQL metrics, and Database size.

With Releem we are trying to bring top-notch experience in performance tuning and save thousands of engineers hours.

    Register for an account

    To use Releem, you need to register an account. To explore the product, we offer you a Free plan. No credit card is required to sign up for the Free plan.

    You can test Releem on up to 3 servers using the Free plan.

    To register an account, do the following steps:
    1. Fill in your email address and full name, choose your account password, and click on the "Sign Up" button.
    2. We'll email you to verify your email address. Please open the link we sent to you through email to activate your Releem account
      Don't see this email in your inbox? Please check your spam folder and whether you've typed in the correct email address. Contact us if the problem persists.

    Add server

    To monitor and tune Self-Managed MySQL servers Releem Agent should be installed on the same server as the MySQL server.

    To add a server to the Releem Dashboard, you need to install the Releem Agent.

    The installation process varies depending on whether your server is self-managed or cloud-managed. Releem supports the following types of installations:
    1. Self-Managed Servers Automatic Installation
      This is the simplest and fully automatic way to install Releem Agent. Just click on to "Add server" link at Releem Customer Portal and follow the instructions. Use this guide if the MySQL server is installed on the localhost and you have the MySQL root password.
    2. Self-Managed Servers Manual Installation
      This is the universal way to install Releem Agent. It isn't simple as Automatic Installation. Use this guide if you don't have a MySQL root user or MySQL installed on a different IP address or want to create a Releem user manually.
    3. Self-Managed Servers Docker Installation
      The guide helps to Install Releem Agent in the Docker container. Use it only if you're using MySQL in Docker and don't want to install additional software on the host instance.
    4. Cloud-Managed AWS RDS Automatic Installation
      This is the simplest and fully automatic way to install Releem Agent in AWS Cloud to monitor and tune AWS RDS.

    How to verify if the Releem Agent is installed on your server
    After you've installed Releem Agent, you should see the server on the Releem Dashboard and can verify that the integration is working.

    On the Releem Score block, you should see Agent Status - Connected, which indicates that Releem Platform receives metrics from Releem Agent.

      Releem Dashboard

      The Releem Dashboard provides a comprehensive view of your server's performance, making it easy to monitor and optimize your MySQL instance. By regularly reviewing the dashboard, you can proactively address potential issues and maintain peak performance for your database.

      The Releem Dashboard offers insights and recommendations for maintaining and improving MySQL performance. The dashboard consists of several blocks, each focusing on a specific aspect of your server's health and performance.
        1. Releem Score
        The Releem Score block displays the server's status and Releem Score, representing the best practices (health checks) for maintaining servers. The score provides a quick overview of your server's health, allowing you to assess its performance at a glance.

        2. Recommended Configuration
        The Recommended Configuration block comes into play when Releem identifies opportunities to improve performance. Releem assesses the necessary configuration changes and notifies you when they're ready to apply. This block provides a concise summary of Releem's recommendations, making it easy to implement changes to enhance your MySQL performance. The Releem MySQL tuning process is designed to optimize MySQL performance using a systematic approach.

        3. Health Checks
        MySQL Health Checks are diagnostic tests that evaluate a server's health, performance, and stability. Regular MySQL Health Checks are essential for ensuring optimal server operation and meeting business requirements. Releem performs health checks twice a day, providing users with up-to-date insights into their database's current state.

        4. Performance Metrics
        The Performance Metrics block displays key instance metrics, such as CPU usage, Memory Usage, Swap usage, and IOPS. Monitoring these metrics helps you keep a close eye on your server's performance. Clicking on a metric displays a daily graph, offering a visual representation of the metric's performance over time.

        5. MySQL Metrics Charts
        The MySQL Metrics consists of several charts, including:

        • Latency: This graph shows the P95 MySQL Latency, indicating the query execution time.
        • QPS (Queries Per Second): A measure of the number of queries processed per second.
        • Slow Log Queries: This graph displays the number of slow queries, helping you identify performance bottlenecks.

          Introduction to the Health Checks

          MySQL Health Checks are diagnostic tests that evaluate a server's health, performance, and stability. They play a critical role in maintaining the optimal performance of your MySQL server. Releem regularly calculates and checks a variety of metrics across four main blocks: System, MyISAM/InnoDB, Memory, and Queries/Logs.
          System Block
          The System block monitors essential system-level metrics to ensure the overall health of your server.


          MyISAM/InnoDB Block
          The MyISAM/InnoDB block focuses on specific storage engines and their related metrics.


          Memory Block
          The Memory block checks metrics related to memory usage and allocation.


          Queries/Logs Block
          The Queries/Logs block examines metrics associated with queries and logs.


          By regularly performing MySQL Health Checks and monitoring these metrics, you can proactively address potential issues and maintain peak performance for your database. Releem makes it easy to keep an eye on these crucial metrics and helps you optimize your MySQL server based on its expert recommendations.

          Introduction to the Weekly Reports

          It is necessary to choose a visual aid that is appropriate for the topic and audience.
          Releem Weekly Reports are designed to provide you with a concise yet comprehensive overview of your servers' performance and status. These reports keep you informed about essential information, saving you time and helping you make informed decisions. The updated report includes data on all servers, unapplied recommendations, the status of the Releem Agent, and performance insights such as Latency and QPS improvements.

          Overview of Weekly Report Contents

          1. All Servers
          The report includes a summary of all servers being monitored by Releem, providing an at-a-glance view of their performance and health. This information helps you quickly assess the overall state of your MySQL instances.

          2. Unapplied Recommendations
          The weekly report lists any unapplied recommendations generated by Releem. These recommendations represent opportunities for performance improvement, and applying them can help you maintain an optimally performing MySQL server.

          3. Releem Agent Status
          The report provides an update on the status of the Releem Agent installed on your servers. This information is crucial to ensure the agent functions correctly and provides accurate data to the Releem platform.

          4. Performance Insights
          Releem Weekly Reports include performance insights, such as Latency and QPS improvements. These insights help you gauge the effectiveness of applied recommendations and track the progress of your server's performance over time.

          Benefits of Releem Weekly Reports
          By providing a comprehensive view of your servers' performance and status, Releem Weekly Reports offer several key benefits:
          • Time Savings: The report consolidates essential information, allowing you to quickly review the state of your servers without having to manually compile data.
          • Informed Decision Making: The insights and recommendations provided in the report empower you to make data-driven decisions to optimize your MySQL server's performance.
          • Performance Tracking: Regularly reviewing the weekly report helps you monitor performance trends and identify areas for improvement.
          Releem Weekly Reports are a valuable resource for maintaining and enhancing the performance of your MySQL servers. By staying informed and proactively addressing potential issues, you can ensure your database operates optimally and meets your business requirements.

          How to check if Releem Agent is working

          After you've installed Releem Agent, it's time to check if Releem is working.

          On the Releem Score block, you should see Agent Status - Connected / Monitoring, which indicates that Releem Platform receives metrics from Releem Agent.
          How to troubleshoot Releem Agent
          If the Releem Agent is disconnected, please, take the following steps and check the most common issues.

          • To check Releem Agent status, please run:
            systemctl status releem-agent
          • If Releem Agent is not running to start it please run:
            systemctl start releem-agent
          • If Releem Agent is running but Dashboard informs you that it is disconnected please check the logs
            Debian:
            cat /var/log/syslog | grep releem-agent

            Centos:
            cat /var/log/messages | grep releem-agent

            AWS RDS:
            All logs are stored in Cloudwatch releem-agent log group.

            Docker:
            docker logs [container name], by default releem-agent
          Releem Agent Common Issues
          1. In the MySQL log file: [Warning] Aborted connection 181 to db: 'mysql' user: 'releem' host: 'localhost' (Got timeout reading communication packets)

          CloudLinux MySQLGovernor blocks MySQL "releem" user.
          Please exclude "releem" user from MySQLGovernor.

          Introduction to the Recommended Configuration

          The Recommended Configuration block displays the current state of the Releem platform as it works to identify performance improvements for your MySQL server. This block provides valuable insights into the optimization process, allowing you to monitor progress and take action as needed.
          The Recommended Configuration block consists of several components:

          1. Progress Bar: The progress bar shows the current platform state, which can be in one of two states: "Searching Opportunities" or "Preparing Configuration" The Releem platform uses AI to continuously search for opportunities to enhance MySQL performance. If Releem identifies a viable hypothesis, the expert system checks whether it can be safely applied. Once all checks are complete, Releem prepares the recommended configuration.

          2. Unapplied Recommendations Count: This displays the number of recommendations that have not yet been applied to your server.

          3. Full Recommended Configuration Link: Click this link to view the complete recommended configuration generated by Releem.

          4. Instructions to Apply Recommended Configuration: Follow these step-by-step instructions to implement the recommended configuration on your server.

          Releem automates the process of applying and rolling back recommended configurations for self-managed instances where the Releem Agent is installed without Docker. These features are accessible via the following links:

          • How to Apply: Click this link to access a guide on applying the recommended configuration to your server.
          • How to Rollback: Click this link to access a guide on rolling back the recommended configuration if needed.

          Utilizing the Recommended Configuration block lets you stay informed about the optimization process and easily apply or roll back configurations as needed to maintain optimal MySQL performance.
            How long does it take to receive my first recommended configuration?
            You'll receive your first set of recommended configurations within 24 hours of adding your server to Releem.
            How often will I receive new recommended configurations?
            Releem continuously searches for opportunities to improve your MySQL performance. Whenever our system identifies a viable hypothesis, we'll generate a new set of recommendations and notify you. The frequency of new recommendations depends on your server's unique performance patterns and workload.

            MySQL Tuning Process

            The Releem MySQL tuning process is designed to optimize MySQL performance using a systematic approach that involves several stages. Each stage plays a crucial role in ensuring that the resulting configuration improves your server's performance while maintaining stability and security.

            Stage 1: Collecting Baseline
            After installing the Releem Agent, the platform will collect baseline data over several days. This data is used to train the AI, allowing it to recognize when a new configuration leads to improved performance.

            Stage 2: Searching for Opportunities
            The Releem platform uses AI to continuously search for opportunities to enhance MySQL performance. On the Free plan, Releem tunes only 10 MySQL variables, while the Premium plan offers tuning of more variables.

            Stage 3: Expert System Evaluation
            If Releem's AI identifies a viable hypothesis for performance improvement, the platform's expert system will assess whether it can be safely applied to your server. This step ensures that any proposed changes do not adversely affect the stability or security of your MySQL instance.

            Stage 4: Preparing New Configuration
            Once the expert system has verified the safety of a proposed change, Releem will prepare a new configuration and display it to the user. At this stage, you will see the number of unapplied recommendations in the Recommended Configuration block.

            Stage 5: Applying Recommended Configuration
            When the recommended configuration is ready, you should apply it to your server. You can do this manually or automatically using the Releem Agent, depending on your server type and installation method. After applying the configuration, it may take up to 12 hours for Releem to detect the changes and update the unapplied recommendations count.

            By following these stages, the Releem tuning process ensures that your MySQL server's performance is optimized safely and effectively. Regularly reviewing and applying recommended configurations will help you maintain peak performance and meet your business requirements.

              Automatic Installation

              Use this instruction to install Releem Agent automatically on every database server. Releem Agent will automatically collect metrics and recommend configuration.

              1. Click "Add Server" link at Releem Customer Portal
              2. Fill fields:
                - MySQL Root User Password (we don't store this password, it uses only to build Installation command)
                - MySQL Memory Limit in Megabytes. Use this field only if it case there are installed other software on your server.
              3. Copy the Installation command, paste it into the terminal, and execute as a root user.

              Manual Installation

              Use this instruction to install Releem Agent manually on every database server. Releem Agent will automatically collect metrics and recommend configuration.

              1. Create read-only user "releem" in MySQL using the instruction
              Installation without Docker
              2. Run Installation command as a root user on the server:
              
              RELEEM_MYSQL_PASSWORD='[Password]' RELEEM_MYSQL_LOGIN='releem' RELEEM_MYSQL_MEMORY_LIMIT=0 RELEEM_API_KEY=[Key] RELEEM_CRON_ENABLE=1 bash -c "$(curl -L https://releem.s3.amazonaws.com/v2/install.sh)"
              
              Parameters:
              • RELEEM_MYSQL_LOGIN - MySQL User name to collect MySQL metrics
              • RELEEM_MYSQL_PASSWORD - MySQL User password to collect MySQL metrics
              • RELEEM_MYSQL_MEMORY_LIMIT - Change parameter in case there are other software installed on the server. Default value is 0 means use all memory.
              • RELEEM_API_KEY - API Key. Get it from Profile page in Releem Customer Portal.
              • RELEEM_MYSQL_HOST - use this variable in case MySQL listen different interface or connection available only through socket.
              Docker Installation
              2. Run the container using Docker or Docker compose
              • Docker
                The basic pattern for starting a Releem Agent instance is:
              
              docker run -d -ti --name 'releem-agent' -e RELEEM_HOSTNAME="[Hostname]" -e DB_HOST="[DB_HOST]" -e DB_PORT="[DB_PORT]" -e DB_PASSWORD="[RELEEM_MYSQL_PASSWORD]" -e DB_USER="releem" -e RELEEM_API_KEY="[RELEEM_API_KEY]" -e MEMORY_LIMIT=[MEMORY_LIMIT] releem/releem-agent:1.5.0.3
              
              • Docker Compose
              
              version: '3.7'
              services:
                releem-agent:
                  image: releem/releem-agent
                  container_name: releem-agent
                  environment:
                    MEMORY_LIMIT: "${MEMORY_LIMIT}"
                    DB_USER: "releem"
                    RELEEM_API_KEY: "${RELEEM_API_KEY}"
                    DB_PASSWORD: "${RELEEM_MYSQL_PASSWORD}"
                    DB_PORT: "${DB_PORT}"
                    DB_HOST: "${DB_HOST}"
                  restart: unless-stopped
                  volumes:
                    - /tmp/.mysqlconfigurer/:/tmp/.mysqlconfigurer/
                    - /etc/mysql/releem.conf.d/:/etc/mysql/releem.conf.d/
              
              Parameters:
              • RELEEM_HOSTNAME - Server hostname, which should display in the Releem Dashboard.
              • RELEEM_INTERVAL_COLLECT_ALL_METRICS - Interval in seconds how often Releem Agent collects all metrics. If you have more than 500 databases, we suggest setting this variable to 86400.
              • RELEEM_API_KEY - Releem API Key. To get your Releem API Key, please sign up.
              • DB_USER - MySQL user name for data collection
              • DB_PASSWORD - MySQL user password name for data collection
              • DB_HOST - MySQL host for data collection
              • DB_PORT - MySQL port for data collection
              • MEMORY_LIMIT - RAM limit allocated for MySQL. Set to system RAM or limit for MySQL

              Volumes:
              • /tmp/.mysqlconfigurer/
              • /etc/mysql/releem.conf.d/
              3. To automate applying new settings and enable Performance Scheme and Slowlog please mount the following folder to the MySQL container. volumes:
              • /etc/mysql/releem.conf.d/:/etc/mysql/conf.d/

              4. Add the following line to the my.cnf file of the MySQL container "!includedir /etc/mysql/conf.d"
              Kubernetes Installation
              The example of Releem agent deployment for MariaDB cluster in Kubernetes:
              
              apiVersion: v1
              kind: PersistentVolumeClaim
              metadata:
                name: releem-agent-claim0-primary
                namespace:  your-name-space
              spec:
                accessModes:
                  - ReadWriteOnce
                resources:
                  requests:
                    storage: 1Gi
              ---
              apiVersion: v1
              kind: PersistentVolumeClaim
              metadata:
                name: releem-agent-claim1-primary
                namespace: your-name-space
              spec:
                accessModes:
                  - ReadWriteOnce
                resources:
                  requests:
                    storage: 1Gi
              ---
              apiVersion: v1
              kind: PersistentVolumeClaim
              metadata:
                name: releem-agent-claim0-secondary
                namespace: your-name-space
              spec:
                accessModes:
                  - ReadWriteOnce
                resources:
                  requests:
                    storage: 1Gi
              ---
              apiVersion: v1
              kind: PersistentVolumeClaim
              metadata:
                name: releem-agent-claim1-secondary
                namespace: your-name-space
              spec:
                accessModes:
                  - ReadWriteOnce
                resources:
                  requests:
                    storage: 1Gi       
              ---
              apiVersion: apps/v1    
              kind: Deployment
              metadata:
                name: releem-agent-primary
                namespace: your-name-space
                labels:
                  tier: backend
                  version: 1.0.1
              spec:
                selector:
                  matchLabels:
                    app: releem-agent-primary
                    tier: backend
                replicas: 1
                strategy:
                  type: Recreate
                template:
                  metadata:
                    labels:
                      app: releem-agent-primary
                      tier: backend
                  spec:
                    affinity:
                      nodeAffinity:
                        requiredDuringSchedulingIgnoredDuringExecution:
                          nodeSelectorTerms:
                          - matchExpressions:
                            - key: use
                              operator: In
                              values:
                              - database
                      podAffinity:
                        requiredDuringSchedulingIgnoredDuringExecution:
                        - labelSelector:
                            matchExpressions:
                            - key: statefulset.kubernetes.io/pod-name
                              operator: In
                              values:
                              - your-name-space-mariadb-primary-0
                          topologyKey: kubernetes.io/hostname
                    containers:
                    - name: releem-agent-primary
                      image: releem/releem-agent:1.12.0
                      imagePullPolicy: IfNotPresent
                      env:
                      - name: MEMORY_LIMIT
                        value: "28672"
                      - name: DB_USER
                        value: "your-user"
                      - name: RELEEM_API_KEY
                        value: "your-key"
                      - name: DB_PASSWORD
                        value: "your-passw"
                      - name: DB_PORT
                        value: "3306"
                      - name: DB_HOST
                        value: "your-db-service"
                      volumeMounts:
                        - mountPath: /opt/releem/conf/
                          name: releem-agent-claim0
                        - mountPath: /etc/mysql/releem.conf.d/
                          name: releem-agent-claim1
                    restartPolicy: Always
                    volumes:
                      - name: releem-agent-claim0
                        persistentVolumeClaim:
                          claimName: releem-agent-claim0-primary
                      - name: releem-agent-claim1
                        persistentVolumeClaim:
                          claimName: releem-agent-claim1-primary
              ---
              apiVersion: apps/v1    
              kind: Deployment
              metadata:
                name: releem-agent-secondary
                namespace: your-name-space
                labels:
                  tier: backend
                  version: 1.0.1
              spec:
                selector:
                  matchLabels:
                    app: releem-agent-secondary
                    tier: backend
                replicas: 1
                strategy:
                  type: Recreate
                template:
                  metadata:
                    labels:
                      app: releem-agent-secondary
                      tier: backend
                  spec:
                    affinity:
                      nodeAffinity:
                        requiredDuringSchedulingIgnoredDuringExecution:
                          nodeSelectorTerms:
                          - matchExpressions:
                            - key: use
                              operator: In
                              values:
                              - database
                      podAffinity:
                        requiredDuringSchedulingIgnoredDuringExecution:
                        - labelSelector:
                            matchExpressions:
                            - key: statefulset.kubernetes.io/pod-name
                              operator: In
                              values:
                              - your-name-space-mariadb-secondary-0
                          topologyKey: kubernetes.io/hostname
                    containers:
                    - name: releem-agent-secondary
                      image: releem/releem-agent:1.12.0
                      imagePullPolicy: IfNotPresent
                      env:
                      - name: MEMORY_LIMIT
                        value: "28672"
                      - name: DB_USER
                        value: "your-user"
                      - name: RELEEM_API_KEY
                        value: "your-key"
                      - name: DB_PASSWORD
                        value: "your-passw"
                      - name: DB_PORT
                        value: "3306"
                      - name: DB_HOST
                        value: "your-db-service"
                      volumeMounts:
                        - mountPath: /opt/releem/conf/
                          name: releem-agent-claim0
                        - mountPath: /etc/mysql/releem.conf.d/
                          name: releem-agent-claim1
                    restartPolicy: Always
                    volumes:
                      - name: releem-agent-claim0
                        persistentVolumeClaim:
                          claimName: releem-agent-claim0-secondary
                      - name: releem-agent-claim1
                        persistentVolumeClaim:
                          claimName: releem-agent-claim1-secondary
              
              Installation on Old Systems Without HTTPS
              2. Run the following commands manually as a root user
              
              mkdir -p /opt/releem/ /opt/releem/conf /etc/mysql/releem.conf.d 
              curl -L -o /opt/releem/mysqlconfigurer.sh http://releem.s3.amazonaws.com/test/mysqlconfigurer.sh 
              curl -L -o /opt/releem/releem-agent http://releem.s3.amazonaws.com/test/releem-agent-$(arch) 
              chmod 755 /opt/releem/mysqlconfigurer.sh /opt/releem/releem-agent 
              echo -e '\n!includedir /etc/mysql/releem.conf.d' | tee -a /etc/mysql/my.cnf 
              ( crontab -l 2>/dev/null | grep -v "/opt/releem/mysqlconfigurer.sh" || true; echo "00 00 * * * PATH=/bin:/sbin:/usr/bin:/usr/sbin /bin/bash /opt/releem/mysqlconfigurer.sh -u") | crontab - 
              
              3. Run the following commands manually and set in /opt/releem/releem.conf file mysql_password as previously generated password on the step 1, and api_key for your account which you could find here
              
              cat <<EOT >> /opt/releem/releem.conf 
              apikey="api_key" 
              releem_cnf_dir="/opt/releem/conf" 
              mysql_user="releem" 
              mysql_password="[Password]" 
              mysql_restart_service="/etc/init.d/mysql restart" 
              mysql_cnf_dir="/etc/mysql/releem.conf.d" 
              EOT
              
              
              /opt/releem/releem-agent -f ; timeout 3 /opt/releem/releem-agent 
              /opt/releem/releem-agent install ; /opt/releem/releem-agent start 
              /bin/bash /opt/releem/mysqlconfigurer.sh -u ;/bin/bash /opt/releem/mysqlconfigurer.sh -p 
              
              
              Manual Installation on other Systems without automatic installation support
              2. Run the following commands manually as a root user
              
              mkdir -p /opt/releem/ /opt/releem/conf /etc/mysql/releem.conf.d
              curl -L -o /opt/releem/mysqlconfigurer.sh https://releem.s3.amazonaws.com/v2/mysqlconfigurer.sh
              curl -L -o /opt/releem/releem-agent https://releem.s3.amazonaws.com/v2/releem-agent-$(arch)
              chmod 755 /opt/releem/mysqlconfigurer.sh /opt/releem/releem-agent
              echo -e '\n!includedir /etc/mysql/releem.conf.d' |  tee -a /etc/my.cnf
              ( crontab -l 2>/dev/null | grep -v "/opt/releem/mysqlconfigurer.sh" || true; echo "00 00 * * * PATH=/bin:/sbin:/usr/bin:/usr/sbin /bin/bash /opt/releem/mysqlconfigurer.sh -u") |  crontab -
              
              3. Run the following commands manually and set in /opt/releem/releem.conf file mysql_password as previously generated password on the step 1, and api_key for your account which you could find here
              
              cat <<EOT >> /opt/releem/releem.conf
              apikey="api_key"
              releem_cnf_dir="/opt/releem/conf"
              mysql_user="releem"
              mysql_password="[Password]"
              mysql_restart_service="/etc/init.d/mysql restart"
              mysql_cnf_dir="/etc/mysql/releem.conf.d"
              EOT
              
              
              
              /opt/releem/releem-agent -f ; timeout 5 /opt/releem/releem-agent
              /opt/releem/releem-agent install ; /opt/releem/releem-agent  start
              /bin/bash /opt/releem/mysqlconfigurer.sh -u ; /bin/bash /opt/releem/mysqlconfigurer.sh -p
              
              

              Automatic Installation for RDS

              Use this instruction to install Releem Agent automatically via CloudFormation to AWS Fargate. Releem Agent will run in the container.

              The requirements for RDS instance:
              • Enhanced monitoring to collect system performance metrics.
              • Performance Insights to collect MySQL performance metrics.

              The CloudFormation will deploy Releem Agent container using AWS Fargate service to collect metrics from your AWS RDS instance and send them to Releem Cloud Platform.
              The template will create roles to run Releem Agent with the following permissions:
              • logs:Get*
              • rds:Describe*
              • cloudwatch:Get*
              • ecr:GetAuthorizationToken
              • ecr:BatchCheckLayerAvailability
              • ecr:GetDownloadUrlForLayer
              • ecr:BatchGetImage
              To move forward just do the following steps:
              1. Create read-only user "releem" in MySQL using the instruction
              2. To run the installation, please sign in to your AWS account and choose the region where RDS is installed
              3. Open CloudFormation link in the browser, check that right region is selected, and fill the following fields:
              • DBID - RDS DB Instance ID. If you're using a cluster, please set the instance name you would like to tune.
              • DBUser - User to collect metrics from the SQL server, that we added in the step 1.
              • DBPassword - Password for user
              • SecurityGroupIDs - Releem Agent SecurityGroups to connect to RDS. Please Allow All Outbound traffic for Releem Agent Security Group.
              • SubnetIDs - Releem Agent container should be able to connect to RDS.
              4. Next, click "Create Stack".
              Common Issues for AWS RDS
              To check Releem Agent logs please open CloudWatch -> Log Groups and then select Releem Agent log group.

              1. Failed to read log stream %s:%s: %s RDSOSMetrics
              Enable Enhanced monitoring for your RDS instance.

              2. No Latency graph on Releem Dashboard
              Enable Performance Insights for your RDS instance.

              3. Error 1045 (28000): Access denied for user 'releem'@'' (using password: YES)
              Check password for Releem User that you created according this guide. And reinstall Releem Agent.
              To set new password please run in MySQL console the following command:
              ALTER USER 'releem'@'%' IDENTIFIED BY 'New-Password-Here';

              4. Connect: connection timed out
              Check that SecurityGroup of RDS instance has Inbound rule to accept connections from Releem Agent installed in ECS.

              5. CloudFormation stack is not finished, still "in progress" for a long time
              Enable Performance Insights and Enhanced monitoring for your RDS instance.
              Check that SecurityGroup that you set for Releem Agent has a rule for All outbound traffic.

              Manual Installation for RDS on the EC2 instance

              Use this instruction to install Releem Agent manually on the EC2 instance to tune AWS RDS. Releem Agent will automatically collect metrics and recommend configuration.

              The requirements for RDS instance:
              • Enhanced monitoring to collect system performance metrics.
              • Performance Insights to collect MySQL performance metrics.

              To move forward just do the following steps:
              1. Create read-only user "releem" in MySQL using the instruction
              2. Add IAM role releem-agent-role and apply it to the EC2 instance:
              
              { 
                "Version": "2012-10-17", 
                "Statement": [ 
                  { 
                    "Action": [ 
                      "rds:Describe*", 
                      "cloudwatch:Get*", 
                      "logs:Get*", 
                      "ec2:Describe*" 
                    ], 
                    "Resource": "*", 
                    "Effect": "Allow" 
                  } 
                ] 
              } 
              
              Installation without Docker
              3. Run Installation command as a root user on the server:
              
              RELEEM_MYSQL_HOST='[RDS_ENDPOINT]' RELEEM_MYSQL_PASSWORD='[Password]' RELEEM_MYSQL_LOGIN='releem' RELEEM_MYSQL_MEMORY_LIMIT=0 RELEEM_API_KEY=[Key] RELEEM_CRON_ENABLE=1 bash -c "$(curl -L https://releem.s3.amazonaws.com/v2/install.sh)"
              
              Parameters:
              • RELEEM_MYSQL_LOGIN - MySQL User name to collect MySQL metrics
              • RELEEM_MYSQL_PASSWORD - MySQL User password to collect MySQL metrics
              • RELEEM_MYSQL_MEMORY_LIMIT - Change parameter in case there are other software installed on the server. Default value is 0 means use all memory.
              • RELEEM_API_KEY - API Key. Get it from Profile page in Releem Customer Portal.
              • RELEEM_MYSQL_HOST - use this variable in case MySQL listen different interface or connection available only through socket.

              4. Add following lines to the /opt/releem/releem.conf:
              Please change aws_region and aws_rds_db settings
              
              instance_type="aws/rds"
              aws_region="[AWS_REGION]"
              aws_rds_db="[RDS_INSTANCE_NAME]"
              
              5. Restart Releem Agent using the following command:
              
              systemctl restart releem-agent
              
              Installation using Docker
              3. Run Releem Agent container using the following command:
              
              docker run -d -ti --restart=always --name 'releem-agent' -e DB_PASSWORD="[RELEEM_MYSQL_PASSWORD]" -e DB_USER="releem" -e RELEEM_API_KEY="[RELEEM_API_KEY]" -e INSTANCE_TYPE="aws/rds" -e AWS_RDS_DB="[RDS_INSTANCE_NAME]" releem/releem-agent:1.0.4.1
              
              Parameters:
              • DB_USER - MySQL User name to collect MySQL metrics
              • DB_PASSWORD - MySQL User password to collect MySQL metrics
              • RELEEM_API_KEY - API Key. Get it from Profile page in Releem Customer Portal.
              • RELEEM_MYSQL_HOST - use this variable in case MySQL listen different interface or connection available only through socket.
              • AWS_RDS_DB - RDS instance name.

              Example of Recommended MySQL Configuration

              Example of the recommended configuration file /tmp/.mysqlconfigurer/z_aiops_mysql.cnf:
              
              [mysqld]
              query_cache_type = 1 ### Previous value : ON
              query_cache_size = 128M ### Previous value : 134217728
              query_cache_limit = 16M ### Previous value : 16777216
              thread_cache_size = 8 ### Previous value : 8
              key_buffer_size = 205520896 ### Previous value : 205520896
              max_allowed_packet = 1073741824 ### Previous value : 67108864
              sort_buffer_size = 16777216 ### Previous value : 25165824
              read_rnd_buffer_size = 4194304 ### Previous value : 4194304
              bulk_insert_buffer_size = 8M ### Previous value : 2097152
              myisam_sort_buffer_size = 8388608 ### Previous value : 25165824
              innodb_buffer_pool_instances = 2 ### Previous value : 3
              innodb_buffer_pool_size = 3019898880 ### Previous value : 3019898880
              max_heap_table_size = 256M ### Previous value : 268435456
              tmp_table_size = 256M ### Previous value : 268435456
              join_buffer_size = 8M ### Previous value : 8388608
              max_connections = 151 ### Previous value : 151
              table_open_cache = 3072 ### Previous value : 3072
              table_definition_cache = 1920 ### Previous value : 1920
              innodb_flush_log_at_trx_commit = 2 ### Previous value : 2
              innodb_log_file_size = 377487360 ### Previous value : 805306368
              innodb_write_io_threads = 4 ### Previous value : 4
              innodb_read_io_threads = 4 ### Previous value : 4
              innodb_file_per_table = 1 ### Previous value : ON
              innodb_flush_method = O_DIRECT ### Previous value :
              innodb_thread_concurrency = 0 ### Previous value : 0
              

              Releem Agent MySQL user permissions

              Create read-only user "releem" in MySQL which Releem Agent will use to collect MySQL metrics
              Change [Password] to your secret password
              
              CREATE USER 'releem'@'%' identified by '[Password]';
              GRANT PROCESS, REPLICATION CLIENT, SHOW VIEW ON *.* TO 'releem'@'%';
              GRANT SELECT ON performance_schema.events_statements_summary_by_digest TO 'releem'@'%';
              

              How to limit memory for MySQL

              If your server has not only MySQL installed, but also other software like a web server, it is important to limit the memory allocated for MySQL using the memory_limit option in Releem Agent configuration. This option will inform Releem Platform to limit memory for MySQL and helps ensure that MySQL does not consume excessive resources and affect the performance of other applications on the server.

              To set the memory limit for Releem Agent, follow the steps below:
              1. Open the Releem configuration file located at /opt/releem/releem.conf using your preferred text editor.
              2. Add the memory_limit option followed by the desired memory limit in MB. For example, to set a memory limit of 28,672 MB, add the following line to the configuration file:
                memory_limit=28672
              3. Save and close the configuration file.
              4. Restart the Releem Agent by running the following command:
              
              systemctl restart releem-agent
              
              By setting the memory_limit option, you can effectively control the amount of memory allocated to MySQL and ensure that your server continues to perform optimally with other installed software.

              It takes up to 12 hours to update limit in the dashboard and up to 3 days to get first recommendations.

              How to apply the Recommended Configuration using Releem Agent

              To apply the recommended configuration, just run the following command:
              /bin/bash /opt/releem/mysqlconfigurer.sh -a

              How to apply the Recommended Configuration using Releem Portal

              To apply the recommended configuration, just click the Apply button and then Apply Now in the Dashboard.
              The configuration will be applied and database server restarted.

              Troubleshooting applying configuration

              1. Recommended MySQL Configuration Not Found:
                This issue arises if the process of applying recommendations is initiated before the Releem platform has completed generating these recommendations.
                User Action: Wait for approximately 12 hours to allow Releem to generate recommendations, or force the process by running /opt/releem/releem-agent -f
              2. MySQL Version Lower Than 5.6.7:
                Releem's automated features may not fully support MySQL versions lower than 5.6.7, especially if file replacement is required for an update.
                User Action: Manual applying of MySQL configuration is recommended in this case.
              3. MySQL Configuration Directory Not Found:
                This occurs when the installation of the Releem Agent is incorrect, or if the MySQL configuration directory has been deleted by the user.
                User Action: The most straightforward solution is to reinstall the Releem Agent to ensure it's set up correctly.
              4. Command to Restart MySQL Service Not Found:
                This typically indicates an incorrect installation, often seen in Docker environments, where the command to restart MySQL services isn't found or accessible by the Releem Agent.
                User Action: Reinstalling the agent is usually necessary to correct this issue. Also, please check mysql_restart_service setting in the /opt/releem/releem.conf
              5. No Confirmation to Restart Service Received:
                This can occur in scenarios where the database is too large, leading to delays, or in the event of a crash.
                User Action: If the database is large, allow some time for it to restart automatically. If a crash is suspected, check the error logs for more details.
              6. MySQL Service Failed to Start in 1200 Seconds:
                Indicates that the MySQL service did not restart within the expected timeframe, which can happen with large databases or due to a crash.
                User Action: Wait for the service to restart if you have a large database. In the case of a crash, consult the error logs.
              7. MySQL Service Failed to Start:
                This is a more general indication of a crash or failure in starting the MySQL service.
                User Action: The primary recourse here is to check the MySQL error logs to diagnose the reason for the failure.
              8. Failed to finish applying the configuration:
                Agent stopped unexpectedly during applying configuration and unable to send information about task to Releem Platform.
                User Action: send us please the output of the command "journalctl -u releem-agent" to hello@relem.com
              9. Unexpected Releem Agent error:
                Releem Platform received unexpected error from Releem Agent.
                User Action:
                Please check that /opt/releem/mysqlconfigurer.sh is not empty and it has permissions to execute.
                Send us please the output of the command "journalctl -u releem-agent" to hello@relem.com

              How to rollback to the previous configuration using Releem Agent

              Also, you can rollback to the previous configuration. To do that just run:
              /bin/bash /opt/releem/mysqlconfigurer.sh -r

              How to apply the Recommended Configuration Manually

              Releem Agent automatically stores Recommended Configuration at
              /opt/releem/conf/z_aiops_mysql.cnf

              To apply Recommended Configuration perform the following steps:
              1. Copy Recommended Configuration to MySQL configuration folder:
              
              cp /opt/releem/conf/z_aiops_mysql.cnf /etc/mysql/conf.d/ 
              
              In CentOS instead /etc/mysql/conf.d you should use /etc/my.cnf.d/ folder.

              2. Restart MySQL to apply configuration:
              
              service mysqld restart
              
              In case of change 'innodb_log_file_size' only in MySQL 5.6.7 or earlier perform the following commands:
              
              mysql -e"SET GLOBAL innodb_fast_shutdown = 1" 
              service mysql stop
              mv /var/lib/mysql/ib_logfile[01] /tmp
              service mysql start
              

              How to update Releem Agent

              Steps to update Releem Agent
              Releem Agent updates automatically.

              To update Releem Agent manually please follow the steps below:
              1. If installed version of Releem Agent is later than 1.0 then just run: /opt/releem/mysqlconfigurer.sh -u
              2. If installed version of Releem Agent is earlier than version 1.0 then just reinstall it using the instruction on the Add server page in the dashboard.

              How to update Releem Agent in Docker

              Steps to update Releem Agent in Docker
              We automated update of Releem Agent installed in Docker container.

              To setup automated Releem Agent update please follow the steps below:
              1. Download script for update
              
              mkdir -p /opt/releem 
              curl -s -L -o /opt/releem/update_releem_docker.sh https://releem.s3.amazonaws.com/v2/update_releem_docker.sh
              chmod +x /opt/releem/update_releem_docker.sh
              
              2. Set the container name (by default the name of container is "releem-agent") and run the command below for test
              
              PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin bash /opt/releem/update_releem_docker.sh <container_name>
              
              3. Set container name and execute the following command to add script to cron for every Releem Agent container
                
                ( crontab -l 2>/dev/null | grep -v "/opt/releem/update_releem_docker.sh" || true; echo "0 0 * * * PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin bash /opt/releem/update_releem_docker.sh <container_name> >> /tmp/update_releem_docker.log 2>&1") | crontab -
                

                How to update Releem Agent for AWS

                Steps to update Releem Agent for AWS
                To update Releem Agent, please follow the step below:
                1. Go to the Releem Agent CloudFormation stack and click the Update button.
                2. Choose Use current template, click Next
                3. Edit Image field with the current agent version number.
                  For example: releem/releem-agent:1.5.0.3
                4. Then click Next.
                5. Step 3, click Next.
                6. Finally, click Update stack to finish the update.

                How to uninstall Releem Agent

                Steps to uninstall Releem Agent
                To uninstall Releem Agent from the server, please run the following command as root user:
                  
                  bash -c "$(curl -L https://releem.s3.amazonaws.com/v2/install.sh)" uninstall
                  

                  How to update Payment Information

                  Releem is integrated with Paddle to automate subscriptions. You can manage Payment Information in Receipt Email you received from Paddle.

                  If you have any questions just wrote us at hello@releem.com.

                  How to cancel Releem Subscription

                  Releem is integrated with Paddle to automate subscriptions. You can cancel Releem subscription in Receipt Email you received from Paddle.