We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7914
    • 137 Posts
    I really don’t know how to respond to this. I have a log file with the query if that will help anyone...help me? If I am looking at the process list, I see a few "SLEEP" commands, but nothing that lasts more than a second.

    I can’t say that I am looking for a solution, more like an explanation? I guess I wouldn’t even know where to begin to look for queries.

    Just...lost.

    Thank you for your time!

    [EDIT]
    I am forcing SSL via .htaccess
    RewriteCond %{ENV:HTTPS} !on [NC]
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    


    Dunno if that factors into it at all or not.
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Hello,

      The issue in question is related to the database, the htaccess isn’t going to be related in this case. Could you provide us more information about your hosting and site. What snippets/plugins are you using, are the cached, what version of modx are you using etc.

      Thanks,
      AMDbuilder
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 7914
        • 137 Posts
        I am using Rackspace Cloud for my host.
        Talking with them, the SSL cluster does not scale like a "regular" cloud site, nor does the SQL cluster. So, from what I understand, I have tied both hands behind my back. They suggested that I move my db to a cloud server site to allow it to be dedicated - which would allow more connections, which would not bog the site down, which would not bog the SSL cluster down etc. etc. That is something I will be looking into.

        Here is the log file that was sent to me during a "slow" time.
        # User@Host: db_username[db_username] @  [IP ADDRESS]
        # Thread_id: 10825521  Schema: my_database
        # Query_time: 13.472810  Lock_time: 0.000106  Rows_sent: 0  Rows_examined: 0  Rows_affected: 1  Rows_read: 2
        use my_database;
        INSERT INTO `mydb_session` (`id`, `access`, `data`) VALUES ('gidh97olc5491ui6mm56v03se6', 1295643294, 'modx.user.contextTokens|a:0:{}');
        +++++++++++++++++++++++++++++++++++++++++++++++++
        # User@Host: db_username[db_username] @  [IP ADDRESS]
        # Thread_id: 10826745  Schema: my_database
        # Query_time: 10.721688  Lock_time: 0.000039  Rows_sent: 0  Rows_examined: 0  Rows_affected: 1  Rows_read: 1
        use my_database;
        UPDATE `mydb_session` SET `data` = 'modx.user..attributes|a:1:{s:3:\"web\";a:3:{s:16:\"modAccessContext\";a:1:{s:3:\"web\";a:1:{i:0;a:3:{s:9:\"principal\";i:0;s:9:\"authority\";s:1:\"0\";s:6:\"policy\";a:1:{s:4:\"load\";b:1;}}}}s:22:\"modAccessResourceGroup\";a:0:{}s:17:\"modAccessCategory\";a:0:{}}}webDocgroups|a:0:{}modx.user.contextTokens|a:0:{}',`access` = 1295643483 WHERE `id` = 'dn14oll0du53tgm8hbqsncm1n4' LIMIT 1;
        +++++++++++++++++++++++++++++++++++++++++++++++++
        


        If I haven’t gotten laughed out of here yet, this will probably do it. To me, it looks like that is a call from within the manager. By that I mean an admin was accessing/updating a page. There was a save action(s) around the time of the site coming up and down. I think it was just a coincidence though.


        MODx version: 2.6
        I made sure to update my modx install (Revolution) to include the security patch when that post came out.

        Snippets:
        I have a handful that, before I discovered output filters mainly check if there is a value for any given TV. (banner images for example)

        I do not have any custom plugins for this site.

        As far as traditional plugins installed via package management:
        getpage
        getresources
        googlesiteap
        if
        simplesearch
        sitemapfriend
        tinymce
        ultimateparent
        wayfinder

        I believe I have everything checked so they are cached.

        Thank you for your responses, I really appreciate any/all of the insight.
          • 9207 ☆ A M B ☆
          • 2,475 Posts
          Try copying and pasting the slow queries into your local database UI (e.g. Sequel Pro on Mac or SQL-Yog on Windows, or use phpMyAdmin). Be sure to do this on a dev site that you don’t mind messing with, but those queries look trivial to me... simple insert statements, not huge reporting queries. If those queries execute blindingly fast on your local machine (as I expect they will), you can tell that to your host.

          Something else might be going on, of course -- did they give you the entire MySQL slow query log?

            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Those queries are the session storage inserts and updates. Could something be causing the session settings to be hanging a bit?
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 7914
              • 137 Posts
              Quote from: Everett at Jan 22, 2011, 01:21 PM

              Something else might be going on, of course -- did they give you the entire MySQL slow query log?

              No, what you see is what you get. undecided

              I ran both queries locally, I get a "duplicate entry" for one (expected) and "no errors" for the other. (again, expected).

              I have been watching the processes withing phpmyadmin, and the only thing that shows up is a few "SLEEP" commands. The time is never higher than "1" though before the process is dropped. I don’t know a lot about sql, but that doesn’t seem too unacceptable.

              Learning that on RS Cloud, the SQL and SSL clusters do not scale, (unlike cloud sites) + shared resources; I think we are maxing out the server. If the SQL cluster is bogged down, it will cause the site to run slowly. Which, may drag the SSL cluster causing a time-out on the SSL layer. Or, perhaps the SSL cluster is getting bogged down -- it will cause the site to run slowly and/or time-out.

              I think I am going to try to move the db over to a Cloud Server to allow dedicated resources. That way I am only confined by SSL.

              Thank you all again for the insight. I really appreciate the discussion.