Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Bitrix MySQL Freezes: Causes and Solutions

4 min read
09.06.2025

When Bitrix (a popular CMS) experiences MySQL freezing issues, the website may become unresponsive or slow. These problems typically stem from database misconfiguration, high traffic, or resource limits. Here is how to troubleshoot and resolve them.

Bitrix MySQL Freezes Fix
Bitrix freezes on DB — usually buffer pool, indexes, or stuck agents.

For related Bitrix performance / configuration topics, see mbstring.func_overload Bitrix Guide, max_input_vars in Bitrix, Bitrix Error Log — Locate, Enable, Analyze, and How to Set Up cron_events.php for Bitrix.

Common Causes of MySQL Freezing in Bitrix

High Database Load

Large tables and complex queries can overwhelm the database server.

Insufficient Resources

Low CPU, RAM, or disk I/O on the hosting server.

Improper MySQL Configuration

Default MySQL settings may not be optimized for Bitrix.

Locking or Deadlocks

Frequent updates or concurrent database operations causing table locks.

Slow Queries

Unoptimized queries or missing indexes lead to delays.

Disk or Filesystem Issues

A full disk or slow storage (e.g., HDD instead of SSD) can cause lags.

Bitrix Cache System Misconfiguration

Inefficient cache usage increases database queries.

Steps to Diagnose the Problem

Enable MySQL Slow Query Log

  1. Edit MySQL configuration:
    sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
  2. Add or modify:
    slow_query_log = 1
    
    slow_query_log_file = /var/log/mysql-slow.log
    
    long_query_time = 2
  3. Restart MySQL:
    sudo systemctl restart mysql
  4. Analyze the slow query log:
    sudo cat /var/log/mysql-slow.log

Monitor Database Performance

  • Use the SHOW PROCESSLIST command to identify hanging queries:
    SHOW PROCESSLIST;
  • Use htop or top on the server to check CPU/RAM usage:
    htop

Check Table Sizes

  • Identify large tables:
  • SELECT table_name AS "Table",
    
           ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)"
    
    FROM information_schema.TABLES
    
    WHERE table_schema = "your_database_name";

Use Bitrix Performance Monitor

  • Bitrix includes a performance monitor:
    • Navigate to Bitrix Admin Panel > Settings > Performance Monitor.
    • Run tests to detect bottlenecks in queries and scripts.
Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Solutions to Fix MySQL Freezing in Bitrix

Optimize MySQL Configuration

Edit the MySQL configuration file:

sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

Adjust the following settings for better performance:

Setting Recommended Value
innodb_buffer_pool_size 70-80% of total server memory.
max_connections Increase to handle more users (e.g., 200).
query_cache_size 64M (or disable if queries are optimized).
table_open_cache 4096
innodb_log_file_size 256M

Restart MySQL:

sudo systemctl restart mysql

Optimize Database Tables

  1. Repair and optimize tables:
    OPTIMIZE TABLE table_name;
  2. Check and repair corrupted tables:
    REPAIR TABLE table_name;

Index Optimization

Add indexes to frequently queried columns:

ALTER TABLE table_name ADD INDEX (column_name);

Reduce Cache-Related Queries

  • Ensure Bitrix caching is enabled:
    • Bitrix Admin Panel > Settings > Cache Settings.
  • Use memcached or Redis for cache storage instead of MySQL:
    • Install Redis:
    • sudo apt install redis-server php-redis
    • Configure Bitrix to use Redis in the bitrix/php_interface/dbconn.php file:
    • $DBType = "mysql";
      
      $CACHE_TYPE = "memcache";
      
      $CACHE_PORT = "6379";

Upgrade Hosting Infrastructure

  1. Switch to SSD Storage: Faster disk I/O reduces delays caused by large datasets.
  2. Increase Server Resources: Add more RAM, CPU, or storage as needed.
  3. Use Dedicated or Cloud Hosting: Shared hosting may not handle high database load efficiently.

Split Large Tables

  • If a table is excessively large (e.g., logs, sessions), archive older data:
  • DELETE FROM large_table WHERE created_at < '2023-01-01';

Preventive Measures

  1. Regular Database Maintenance:
    • Schedule table optimization and cleanup.
  2. Monitor Performance Regularly:
    • Use tools like mysqltuner:
    • sudo apt install mysqltuner
      mysqltuner
  3. Update Bitrix and MySQL:
    • Ensure both are running the latest stable versions.
  • Diagnose the cause: Check logs, slow queries, and resource usage.
  • Optimize MySQL settings: Adjust configuration to fit your server resources.
  • Enhance caching: Use Redis or memcached for better performance.
  • Consider hardware upgrades: If the server is underpowered, upgrade your hosting plan.
Frequently asked questions
`mysqladmin processlist` (or `SHOW PROCESSLIST` in MySQL CLI). Lines with Time > 5 seconds and State `Sending data` or `Copying to tmp table` show queries that are choking. Look at Info column — the SQL itself often points at the table/joins. Repeated long queries on b_iblock_element_property or b_search_content are typical Bitrix-specific bottlenecks.
60-70% of total RAM when MySQL is the dominant process. For Bitrix on a dedicated DB VPS: full 70%. For combined web+DB VPS: 40-50% (leave room for Apache/PHP-FPM). Sites with > 1 GB of data table size benefit disproportionately — buffer pool needs to hold the working set in memory or every query hits disk.
In Bitrix admin: Settings → Performance → Agents → look for agents with "Last Launch" > 1 day ago and Active=Yes. Click "Disable." Restart with the activate button after fixing what was stuck. SQL backdoor: `UPDATE b_agent SET ACTIVE='N' WHERE LAST_EXEC < NOW() - INTERVAL 1 DAY;`. After, monitor freshly-activated agents to verify they complete in reasonable time.
Bitrix's standard indexes cover most cases, but custom property filters often miss. `EXPLAIN` your slow query — if it shows `Using filesort` or `Using temporary` on b_iblock_element_property, add an index on the specific (IBLOCK_PROPERTY_ID, VALUE) or (IBLOCK_ELEMENT_ID, VALUE) combination your query uses. Test in dev first — large tables need online index creation (pt-online-schema-change) to avoid locks.
Related articles
Error 550 SC-001: What It Means and How to Fix It
SMTP Error 110 (Connection Timed Out): Causes and Fixes
max_input_vars in Bitrix: What It Is and How to Adjust It