When MySQL's InnoDB storage engine reports "the age of the last checkpoint is X, which exceeds the log group capacity Y", it's indicating a fundamental mismatch between your transaction log configuration and actual workload. The checkpoint age represents how many bytes of log data have accumulated since the last checkpoint, while the log group capacity is the total size of your InnoDB log files (innodb_log_file_size × innodb_log_files_in_group).
The error specifically mentions BLOB/TEXT columns because these operations generate substantial redo log entries. Consider this example:
-- Problematic table structure
CREATE TABLE document_store (
id INT AUTO_INCREMENT PRIMARY KEY,
document LONGBLOB,
metadata JSON
) ENGINE=InnoDB;
-- This single insert could trigger the error
INSERT INTO document_store (document) VALUES (LOAD_FILE('/large/file.pdf'));
When such large operations occur, InnoDB must write the entire modification to the redo log before committing. If your log files can't hold this data plus concurrent transactions, you'll see this error.
Short-term Fix
Increase the total log capacity by adjusting these parameters in my.cnf:
[mysqld]
innodb_log_file_size = 256M # Default is often 48M
innodb_log_files_in_group = 3 # Default is usually 2
Remember that changing these requires a clean MySQL shutdown - a restart won't suffice.
Long-term Optimizations
For applications handling large binaries:
-- Alternative 1: External storage
CREATE TABLE documents (
id INT AUTO_INCREMENT PRIMARY KEY,
storage_path VARCHAR(255),
file_size INT,
metadata JSON
);
-- Alternative 2: Compression
CREATE TABLE compressed_docs (
id INT AUTO_INCREMENT PRIMARY KEY,
doc_data LONGBLOB,
CONSTRAINT CHECK_COMPRESSED CHECK (COMPRESS(doc_data) = doc_data)
);
After making changes, verify with:
SHOW ENGINE INNODB STATUS\G
-- Check LOG section for:
-- Log sequence number (current LSN)
-- Last checkpoint at (last checkpoint LSN)
-- The difference should be less than total log capacity
SELECT ROUND(SUM(data_length)/1024/1024, 2) AS size_mb
FROM information_schema.tables
WHERE engine='InnoDB' AND table_name LIKE '%blob%';
For high-throughput systems:
[mysqld]
innodb_log_buffer_size = 64M # Default 16M
innodb_flush_log_at_trx_commit = 2 # Trade durability for performance
innodb_log_write_ahead_size = 8192 # Align with disk sector size
These settings should be tested under production-like loads with careful benchmarking.
The error message indicates your InnoDB's checkpoint age has surpassed the redo log capacity. This occurs when the database can't advance its checkpoint position fast enough to keep up with write operations. The numbers shown (9433856 vs 9433498) represent log sequence number (LSN) offsets.
This typically happens when:
- You're storing large BLOB/TEXT columns (over 10MB)
- innodb_log_file_size is too small for your workload
- Long-running transactions prevent log space reuse
- I/O subsystem can't keep up with write demands
Increase your redo log file size with these steps:
# 1. Add to my.cnf (adjust size based on your largest BLOB)
innodb_log_file_size = 256M
innodb_log_files_in_group = 2
# 2. Clean shutdown (critical!)
SET GLOBAL innodb_fast_shutdown = 0;
SHUTDOWN;
# 3. Remove old log files
rm /var/lib/mysql/ib_logfile*
# 4. Restart MySQL
service mysql start
For write-intensive systems:
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 2 # If some durability can be sacrificed
innodb_io_capacity = 2000 # For SSDs
innodb_io_capacity_max = 4000
Create this diagnostic query:
SELECT
ROUND(MAX(lsn - checkpoint_lsn)/1024/1024, 2) AS checkpoint_age_mb,
ROUND(LOG_FILE_SIZE/1024/1024, 2) AS log_capacity_mb,
ROUND((MAX(lsn - checkpoint_lsn)/LOG_FILE_SIZE)*100, 2) AS usage_pct
FROM
(SELECT variable_value AS LOG_FILE_SIZE
FROM performance_schema.global_variables
WHERE variable_name = 'innodb_log_file_size') vars,
information_schema.innodb_metrics
WHERE
name IN ('log_lsn_current', 'log_lsn_checkpoint');
Consider these architectural changes if the problem persists:
- Offload BLOB storage to object storage (S3, etc.)
- Implement partitioning for tables with large BLOBs
- Upgrade to MySQL 8.0+ which handles large transactions better
For a CMS storing 50MB images, we configured:
innodb_log_file_size = 2G
innodb_log_files_in_group = 3
innodb_log_buffer_size = 128M
innodb_io_capacity_max = 8000
This resolved checkpoint age warnings while maintaining 5ms average write latency.