1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Unmaintained Slow query logger 1.0.1a

Generate a stack trace on slow queries

  1. Xon

    Xon Well-Known Member

    eva2000 likes this.
  2. Xon

    Xon Well-Known Member

  3. Solidus

    Solidus Well-Known Member

    Perfect.
     
  4. Solidus

    Solidus Well-Known Member

    So, how much info will this actually show? Anything close to mysql-slow.log when set in my.cnf?
     
  5. Solidus

    Solidus Well-Known Member

    On install using Chris D's installer,

    Code:
    Only proper Resource Manager URLs are valid
    
    still parses templates and installs though.
     
  6. Alfa1

    Alfa1 Well-Known Member

    Thank you!

    To alter the slow query threshold time which file should I edit?
     
  7. Solidus

    Solidus Well-Known Member

    I don't actually see the slow query page, did it install correctly? I know there are some.
     
  8. Xon

    Xon Well-Known Member

    This is a debugging aid, I don't recommend leaving it on 24/7 if you have lots of things which are hitting the threshold.

    It generates an error log entry, which lists the time and the URL which generated it. There is tend a stack trace to allow you to identify the codepath which generated the slow query.

    It doesn't log the query itself, as often you are dealing with highly generic queries which are generated by some code path.

    https://github.com/Xon/XenForo-Slow...ad/library/SV/SlowQueryLogger/Profiler.php#L8

    Just a adjust the default constructor value, it is currently 1.0 seconds. In the future I'll make it a configurable option.
     
  9. Solidus

    Solidus Well-Known Member

    It's working now. 5 pages of slow queries in 3 hours, is that bad? Mostly 1.5 to 2.5 seconds.
     
  10. Xon

    Xon Well-Known Member

    That means you have pages which take at least 1.5 to 2.5 seconds before they load

    Now, you turn it off and go figure out who to blame :p
     
  11. RoldanLT

    RoldanLT Well-Known Member

    Just install and wait for server log entry right? :)
    No options to configure.
     
    Xon likes this.
  12. RoldanLT

    RoldanLT Well-Known Member

    What if I have very fast CPU and very good SSD I/O speed? :D
    Clockspeed: 4.0 GHz
    Turbo Speed: 4.4 GHz


    I don't think I can reach 1.0 seconds :unsure:.
     
  13. Xon

    Xon Well-Known Member

    Fyi, the initial start of a search is known to take a while, this appears to be a design issue where all content needs to be loaded and then verified viewability.

    Correct.

    The part which comes after, figuring out why the queries are slow is either to be taken up with the add-on author or perhaps extra server resources are required. I've got some performance add-ons which may help, but this is an ongoing effort.
     
  14. Xon

    Xon Well-Known Member

    This is good!

    Try seeing how search behaves, I keep getting slow queries from it :p
     
  15. RoldanLT

    RoldanLT Well-Known Member

    Since the last 20 minutes I installed this addon, and I got 300+ visitors real-time as of Google Analytics right now, every minute I got search entry.
    So far No slow query has been log.
     
  16. Solidus

    Solidus Well-Known Member

    No slow queries since disabling Lazy Image Loader which appeared frequently in logs. Strange.
     
  17. RoldanLT

    RoldanLT Well-Known Member

    If I want to change it to 0.5 seconds, code will be?
    PHP:
    <?php

    class SV_SlowQueryLogger_Profiler extends Zend_Db_Profiler
    {
        protected 
    $reportSlowQueries false;
        protected 
    $slowQuery 0.5;

        public function 
    __construct($reportSlowQueries true$slowQuery 0.5$enabled false)
    Line 6 and 8 should be modified?
     
  18. RoldanLT

    RoldanLT Well-Known Member

    I got first slow query log :D
    But I'm not sure which addon to blame on this:
    Code:
    Error Info
    Exception: Slow query detected: 1.1991 seconds, /t/threadtitle.59788/ - library/SV/SlowQueryLogger/Profiler.php:52
    Generated By: User, 3 minutes ago
    Stack Trace
    #0 /library/Zend/Db/Statement.php(319): SV_SlowQueryLogger_Profiler->queryEnd(7)
    #1 /library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
    #2 /library/XenForo/Model/User.php(1177): Zend_Db_Adapter_Abstract->query('\n\t\t\t\tINSERT INT...', Array)
    #3 /library/XenForo/Controller.php(473): XenForo_Model_User->updateSessionActivity(339774, '112.198.101.239', 'XenForo_Control...', 'Index', 'valid', Array, 1463803215, '')
    #4 /library/XenForo/Controller.php(359): XenForo_Controller->updateSessionActivity(Object(XenForo_ControllerResponse_View), 'XenForo_Control...', 'Index')
    #5 /library/XenForo/FrontController.php(358): XenForo_Controller->postDispatch(Object(XenForo_ControllerResponse_View), 'XenForo_Control...', 'Index')
    #6 /library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
    #7 /index.php(13): XenForo_FrontController->run()
    #8 {main}
    Request State
    array(3) {
      ["url"] => string(75) "http://www.domain.net/t/threadtitle.59788/"
      ["_GET"] => array(1) {
        ["/t/threadtitle_59788/"] => string(0) ""
      }
      ["_POST"] => array(0) {
      }
    }
     
  19. Solidus

    Solidus Well-Known Member

    It won't be an addon unless it specifically mentions one I think. Who knows what that one is.
     
    RoldanLT likes this.
  20. RoldanLT

    RoldanLT Well-Known Member

    Browsing my Member List page generates slow query log also :D (1.4xx seconds to load :/ )
    So I disable Member List Page :).
     

Share This Page