[MDEV-18817] MariaDB 10.1.29 slow query not working Created: 2019-03-05 Updated: 2019-03-09 Resolved: 2019-03-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Configuration |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | timchou | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 18.10;MariaDB 10.1.29; |
||
| Description |
|
Hi My MariaDB 10.1.29 is not logging slow query. Here are config:
and in status command ,I can see slow queries are more than 0:
but in slow log file and in mysql.slow_log,there is nothing at all. anyone can give some help? Thx! |
| Comments |
| Comment by Daniel Black [ 2019-03-05 ] | ||||||||||||||||||||||||
|
Because of log_slow_rate_limit there is a 1/1000 chance that a slow query won't be logged. Is there anything in the mysql error log (`journalctl -u mariadb.service`) about not being able to create the file? What is the permission on /var/log/mysql/? If you lsof -p $(pidof mysqld) | grep /var/log is the slow query log there? Does it have '(deleted)' on that same line (which would indicate a logrotate problem)? | ||||||||||||||||||||||||
| Comment by timchou [ 2019-03-05 ] | ||||||||||||||||||||||||
|
Hi Daniel Thanks for your reply mysql error log has no relative errors:
/var/log/mysql's permission is ok I think:
and you said "Because of log_slow_rate_limit there is a 1/1000 chance that a slow query won't be logged." | ||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-03-09 ] | ||||||||||||||||||||||||
|
With log_slow_rate_limit=1000, only one query out of 1000 is logged. |