We are starting to get close to our production date (8th of January) So I’m testing out the slow query logging, but I’m not getting anything in the slow_query.log file.
My settings:
# Slow Query Log
# --------------
# Logs all slow queries. A query is considered to be slow if its execution time exceeds the slow_query.time value
# defined below.
#
# Slow log query should be enabled similar to other logs
#
logging.slow_query.enabled = true
#
# Slow query time is specified as follows. Any query whose execution time exceed this limit will be logged in the slow
# query log. The time value should be a positive integer followed by either letter 'h' (for hours), letter 'm' (for minutes),
# letter 's' (for seconds), or letters 'ms' (for milliseconds). Examples intervals are '1h' for 1 hour, '5m' for 5 minutes,
# '90s' for 90 seconds, and '500ms' for 500 milliseconds. If no time is specified in the configuration, the default value
# of 1 minute will be used.
#
logging.slow_query.time = 500ms
The results from stardog-admin server status
bash-4.3# stardog-admin server status
Backup Storage Directory : .backup
CPU Load : 0.00 %
Connection Timeout : 1h
Export Storage Directory : .exports
Memory Direct : 16M (Max: 1.0G)
Memory Direct Buffers : 56K (Max: 269M)
Memory Direct Mapped : 16M (Max: 115M)
Memory Direct Pool : 0B (Max: 384M)
Memory Heap : 156M (Max: 910M)
Page Cache Count : 7
Page Cache Hit Ratio : 94.15 %
Page Cache Memory : 298K
Platform Arch : amd64
Platform OS : Linux 4.9.49-moby, Java 1.8.0_111-internal
Query All Graphs : false
Query Timeout : 5m
Security Disabled : false
Slow Query Log : true
Slow Query Threshold : 500ms
Stardog Home : /home/stardog/data
Stardog Version : 5.0.5.1
Strict Parsing : true
Uptime : 6 minutes 17 seconds
Databases :
+------------+-------------+-------+---------+---------------+----------+---------+---------+---------------+----------+
| | Connections | Transactions | Queries |
+------------+-------------+-------+---------+---------------+----------+---------+---------+---------------+----------+
| Name | Open | Open | Total | Avg. Time (s) | Rate/sec | Running | Total | Avg. Time (s) | Rate/sec |
+------------+-------------+-------+---------+---------------+----------+---------+---------+---------------+----------+
| testSesame | 0 | 0 | 0 | 0.000 | 0.000 | 0 | 0 | 0.000 | 0.000 |
+------------+-------------+-------+---------+---------------+----------+---------+---------+---------------+----------+
My query (reasoning enabled). Which takes 20045 ms. Query is designed to be slow.
I'm not sure what the problem is with the logging but I wanted to mention that I wrote a trivial little plugin function for testing slow queries. It just calls sleep to make sure the query takes that much time to complete so your tests don't break when they make Stardog faster. The repo is in a bit of disarray at the moment which I hope to have cleaned up shortly. I can't quite decide how I'd like to package plugins. I'd like to allow people to only install exactly what they need but it's difficult to maintain. If anyone has any thoughts on the subject I'd love some feedback.
Ahh. No worries @pavel, tell him to enjoy thanksgiving (I had forgotten it was this week). If he has time next week it would be great if he could take a look.
Hm, I can’t reproduce the situation, I see queries with and without reasoning in the slow query log file.
Just to make sure we’re not missing anything obvious: you’re checking the slow_query.log file in $STARDOG_HOME, right? I.e. the file that the server creates on startup?
Good that it works for you, I guess I need to keep testing a bit here.
I am checking the slow_query.log file in $STARDOG_HOME, which gets created by stardog. The file didn’t exist until I enabled slow queries logging in the properties file.
@stephen did you manage to reproduce it with the command for creating a database that I posted? I wonder if this is related to query timeout not seeming to work for us and no queries showing up in the running queries page in the web gui?
I realize I didn’t actually explain the problem… Something with named graph security is causing the slow query log not to work correctly. So if you’re testing or otherwise in a position where you don’t need named graph security enabled, you can verify that it does in fact work.