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
    2. 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.
    3. Self-Managed Servers Manual Installation
    4. 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.
    5. Self-Managed Servers Docker Installation
    6. 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.
    7. Cloud-Managed AWS RDS Automatic Installation
    8. 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 - Monitoring, 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 monitoring 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 Monitoring
    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.

    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.

    5. Query & Schema
    The Query Analytics tab provides insights into your database's performance by analyzing top and slow queries, including execution statistics, to help identify and resolve bottlenecks. The Query Optimization tab offers automatic recommendations, such as index suggestions and query enhancements, to improve efficiency and reduce resource usage. The Schema Checks tab ensures your database structure remains optimized through automated reviews that detect inefficiencies and suggest actionable improvements.

    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.

    Introduction to the Query Analytics & Optimization

    Releem's Query Analytics offers detailed insights into MySQL query performance, helping you identify slow and inefficient queries. Whether you are troubleshooting slow queries or fine-tuning for better performance, Releem's Query Analytics is an essential tool for maintaining and enhancing your database's efficiency.
    The block includes the following columns:

    • Count – A running count of how many times the query has executed since the last server restart.
    • Average Execution Time – Shows you the time it takes for each query to execute, allowing you to quickly identify and address slow-performing queries that can hinder your database performance.
    • Load on Total Time – Evaluates the total time consumed by all instances of that query, giving you a clear understanding of the query's cumulative impact on your server. This column includes a helpful visual (orange or blue bar) so you can quickly gauge which queries are having a greater impact.
    • Action – Click the Inspect button to view a specific query in detail.
    How to Show Slow Queries – Sort by Average Time
    To view slow queries, find the Query Analytics Block on the dashboard. Click the 'Avg. Execution Time' column heading. This will sort your top 100 queries in order, with the slowest-executing queries listed at the top.
    How to Show Queries With Highest Performance Impact – Sort by Total Load Time
    To view queries that have the greatest impact on your server's performance, find the Query Analytics Block on the dashboard. Click the 'Load on Total Time' column heading. This will sort your top 100 queries in order, with the queries that are using the most resources overall listed at the top.
    How to Inspect Query Details and Optimize SQL Queries
    Click on the query in the Query Analytics tab to view the full query statement. Click Get Recommendations button the get suggestion on query performance optimization and missed indexes.

    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. Do you use CloudLinux?
    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.

    2. Do you use AWS RDS?
    Common issues for AWS RDS.

    Introduction to the Configuration Tuning

    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. Recommended Configuration Link: Click this link to view the complete recommended configuration suggested by Releem.
    4. Apply button: Click it and follow 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. Learn more about how yo use these features:

    • How to Apply: A guide on applying the recommended configuration to your server.
    • How to Rollback: 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 rollback 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_HOSTNAME - Server hostname, which should display in the Releem Dashboard.
      • 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 listens different interface or connection available only through socket.
      • RELEEM_MYSQL_PORT - use this variable in case MySQL listens different port
      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
      Please use the latest version of Releem Agent. You can find the latest version of Releem Agent by clicking on the link.

      • 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"

      Note: If you don't configure automatic applying of configuration then please add the following MySQL variables to the configuration:
      performance_schema = 1
      slow_query_log = 1
      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.

      Enable Automatic SQL Query Optimization and Index Recommendations

      To enable SQL Query Optimization feature please select you installation and use the following instructions.

      When the feature will be enabled you'll see the first automatic SQL Query Recommendation in a one week.
      Instructions to enable feature for Releem Agent
      1. For self-managed servers
      Automatic installation:
      Note: If your server is already installed, you can use automatic installation, as it won't add a new server if it has the same hostname.
      1. Click "Add Server" link at Releem Customer Portal
      2. Select the installation type
      3. Modify the one-step installation command and the following environment variable:
      RELEEM_QUERY_OPTIMIZATION=true
      4.Run the modified installation command on your server

      If the server is already added, you can copy the following command, change MySQL root password and run it
      RELEEM_MYSQL_ROOT_PASSWORD='password' /bin/bash -c "$(curl -L https://releem.s3.amazonaws.com/v2/install.sh)" enable_query_optimization

      Manual installation:
      If your server is already installed please do the following steps:
      1. Grant additional permissions to releem user. See section below Additional Permission Required
      2. Add query_optimization=true setting to the /opt/releem/releem.conf
      3. Restart Releem Agent using the following command: systemctl restart releem-agent
      4. Run the following command: /opt/releem/mysqlconfigurer.sh -p
      2. For AWS RDS
      Update already installed Releem Agent
      1. Select CloudFormation Stack - releem-agent, click button Update
      2. Select “Replace existing template”
      3. Paste in “Amazon S3 URL” url https://releem.s3.amazonaws.com/test/releem-agent-cloudformation.yml and click “Next”
      4. Change option “QueryOptimization” to true and click “Next”
      5. Click “Next” and “Submit”
      3. For DOCKER
      1. Grant additional permissions to releem user. See section below Additional Permission Required
      2. Re-install Releem Agent with RELEEM_QUERY_OPTIMIZATION=true environment variable enabled.
      Note:
      1. Be sure that the RELEEM_HOSTNAME variable should be the same as currently added server.
      2. If you don't configure automatic applying of configuration then please add the following MySQL variables to the configuration:
      performance-schema-consumer-events-statements-history = ON
      performance-schema-consumer-events-statements-current = ON
      performance_schema_events_statements_history_size = 500
      Additional Database Permissions Required
      The SQL Query Optimization feature requires additional permissions for the Releem Agent user. These permissions will be granted during the automatic installation process. The following SQL command will be executed:
      GRANT SELECT ON *.* TO releem@'%'

      FOR AWS RDS
      With AWS RDS, performance schema consumers can’t be enabled permanently in a configuration. Create the following procedure to give the Agent the ability to enable performance_schema.events_* consumers at runtime:
      CREATE SCHEMA IF NOT EXISTS releem;
      DELIMITER $$
      CREATE PROCEDURE releem.enable_events_statements_consumers()
          SQL SECURITY DEFINER
      BEGIN
          UPDATE performance_schema.setup_consumers SET enabled='YES' WHERE name LIKE 'events_statements_%';
      END $$
      DELIMITER ;
      GRANT EXECUTE ON PROCEDURE releem.enable_events_statements_consumers TO releem@'%';
      Data Collection and Analysis
      Once the SQL Query Optimization feature is enabled, Releem will automatically collect and save the EXPLAIN outputs of the top 100 queries and the top 100 slowest queries. This data helps in analyzing the execution plan of queries and optimizing them further.

      An example of the EXPLAIN output collected by Releem is provided below:
       {
        "query_block": {
          "select_id": 1,
          "cost_info": {
            "query_cost": "0.60"
          },
          "table": {
            "table_name": "sale_internals_order_discount",
            "access_type": "ref",
            "possible_keys": [
              "IX_SALE_ORDER_DSC_HASH"
            ],
            "key": "IX_SALE_ORDER_DSC_HASH",
            "used_key_parts": [
              "DISCOUNT_HASH"
            ],
            "key_length": "98",
            "ref": [
              "const"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 1,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "0.50",
              "eval_cost": "0.10",
              "prefix_cost": "0.60",
              "data_read_per_join": "1K"
            },
            "used_columns": [
              "ID",
              "MODULE_ID",
              "DISCOUNT_ID",
              "NAME",
              "DISCOUNT_HASH",
              "CONDITIONS",
              "UNPACK",
              "ACTIONS",
              "APPLICATION",
              "USE_COUPONS",
              "SORT",
              "PRIORITY",
              "LAST_DISCOUNT",
              "ACTIONS_DESCR"
            ]
          }
        }
      } 

      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.

      You can find the latest version of Releem Agent by clicking on the link.

      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 database user "releem" which Releem Agent will use to collect database metrics. Select your database version, copy SQL statements and run in the MySQL console.

      For MySQL >= 8.0
      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'@'%';
      GRANT SELECT ON performance_schema.table_io_waits_summary_by_index_usage TO 'releem'@'%';
      GRANT SELECT ON performance_schema.file_summary_by_instance TO 'releem'@'%';
      GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO 'releem'@'%';

      For MariaDB and MySQL < 8.0
      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'@'%';
      GRANT SELECT ON performance_schema.table_io_waits_summary_by_index_usage TO 'releem'@'%';
      GRANT SELECT ON performance_schema.file_summary_by_instance TO 'releem'@'%';
      GRANT SUPER ON *.* 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 follow the steps below:
      1. Open the Dashboard->Recommended Configuration->Settings
      2. Set new Memory Limit
      3. Click Save Changes button

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

      How to limit memory for MySQL using Releem Agent configuration

      To set the memory limit using Releem Agent configuration, 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:
      3. memory_limit=28672
      4. Save and close the configuration file.
      5. 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 service restarted.
      In the new version, you can apply the changes without restarting.

      Click "Apply" and then "Apply Without Restart" in the Dashboard to apply the recommended configuration without restarting the database server.
      Applying all parameters may requires restarting the database service.

      Some MySQL variables require a restart to take effect. To apply all changes, click the "Apply" button, followed by "Apply and Restart" in the Dashboard.
      This will apply the configuration and restart the database server.

      Troubleshooting applying configuration

      1. FOR SELF-MANAGED SERVERS
      2. FOR AWS RDS INSTANCES

      Frequently Asked Questions

      I've installed Releem Agent. How do I check if I've done it correctly?
      We created a guide for you to make this process easier. Learn more
      Why high Latency occurs after applying recommended configuration?
      Releem restarts MySQL to apply recommended configurations. Latency often spikes due to the database operating with cold caches. Learn more
      I applied all recommendations, but Releem Score is not 100%. How I can improve it?
      This indicates that certain health checks differ from best practices. Avoid taking any action, Releem will consistently seek to enhance it.
      I applied all recommendations, but not all Health Checks are checked. How I can improve it?
      This indicates that certain health checks differ from best practices. Avoid taking any action, Releem will consistently seek to enhance it.
      Would Releem automatically change MySQL configuration without my approval?
      Rest assured, Releem does not automatically implement any configurations without your explicit action. Configurations are applied only when you choose to hit the "Apply Now" button or execute a specific SSH command. Before making any changes, you have the opportunity to review and compare the proposed configurations with your current settings.

      Additionally, for those who prefer, there's an option to automate the application of configurations during maintenance window by setting up a dedicated cron job.
      How do I add my business details and the VAT number?
      You have the option to include your business address and VAT identification on the payment page while upgrading. Additionally, you can access any of your past invoices and select the Add Address & VAT Number link to accomplish this.
      How do I get an invoice?
      You have the option to include your business address and VAT identification on the payment page while upgrading. Additionally, you can access any of your past invoices and select the Add Address & VAT Number link to accomplish this.

      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. You can find the latest version of Releem Agent in the Update Notification message in the Dashboard or by clicking on the link
        4. For example: releem/releem-agent:1.5.0.3
        5. Then click Next.
        6. Step 3, click Next.
        7. 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.