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 am writing this as more of a knowledge quest vs. a "It doesn’t work" post. I have posted about this a little before and I am very grateful for the feedback/discussion.

    I am using Rackspace as a host, MODx 2.0.6. The site is considered to be a "Cloud Site" to be technically correct.
    9 out of 10 days, the site works great, there is no downtime and the site runs quickly. Then it seems it will randomly pick a time and take a huge performance hit. Sometimes to the level of getting time out warnings from the server.

    I am forcing SSL via the .htaccess on the site, so I am dealing with 3 different "clusters"
    1.) cloud site
    2.) database
    3.) ssl

    I have been told by Rackspace that the database and/or ssl server(s) are not load balanced. I have also been told that the SSL server is load balanced. Either way, the ceiling for max connections etc. has got to be quite high. At least I would think it would be.

    When my site is struggling to stay alive, I am always told that I have slow SQL queries and/or I have connections that could not be getting closed. I am instructed to verify that all connections are getting closed and that my database tables are well optimized. I’ll be the first to admit - I have no clue where to look to even respond to that other than "Thanks, I’ll look into it."

    I have talked to Rackspace in general to see if CMS sites are acceptable to run on their platform.

    ...most sites will work fine in Cloud Sites, especially CMS based sites like Wordpress, Joomla, and Drupal...


    Even though our database servers are not load balanced, as long as your database itself is optimized properly and your queries are not having to scan thousands of rows within the database tables it should be just fine.

    And finally...

    ...But because the database was optimized it handled it just fine. And believe it or not, their site is based on Wordpress...


    The MODx development team has built an outstanding product. I believe it is far superior to WP or any other CMS(framework) I have a very hard time believing that Rackspace and MODx can’t play nice together. Maybe it’s something that I have done. I’m willing to share about any aspect of the project to see if what I did or how I installed etc. that would cause a hit to performance.

    Things like "Make sure the database is optimized" seems very...elementary. Based on the entire scope of the MODx project, I don’t want to say that a statement like that is insulting but if I had built something like this, I would probably scoff at that. "Of course it is..."

    I apologize for the long post, but just wanted to get a better grasp of things, maybe understand things on a kindergarten level. If nothing else for peace of mind. Thank you to anyone who responds, I really do appreciate any feedback/comments.
      • 28215
      • 4,149 Posts
      Hard to help, not knowing what specifically is causing your issue. Can you detail your server environment, and some details about your site setup and structure?

      I do know you shouldn’t be getting issues like that.

      Also, let us know what Extras you’re using.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 22840
        • 1,572 Posts
        Just to say something on this, and it is no way to dispute rackspace but heres the story:

        About 18 months ago the company I work for hosted with site 5, we were getting a lot of downtime so went over to rackspace with a dedicated server that I support and administer, everything went down hill from there as we installed whm and cpanel instead of plesk and they totally refuse to support the server for things that are server problems, all we get is you have whm, sod off, this is despite the fact we pay around £300 a month for support.

        I hosted my revo site on there ( in my sig ) whilst I was looking for alternative hosts and have actually gone back to site 5 which have support for revo and are great, if I have a problem I just go onto the live chat and its sorted.

        We still have a revo build on the rackspace server and there is a very big noticeable difference in speed despite them being the same version.

        All in all i would never host another revo site on rackspace, they may get upto speed eventualy but site 5 is far cheeper, better support and can handle it 100%

        Just my 2c
          • 7914
          • 137 Posts
          Quote from: splittingred at Jan 27, 2011, 04:57 PM

          Hard to help, not knowing what specifically is causing your issue.

          Absolutely understand 100%. I hope I don’t come across as a "help, please fix" but more of a "here are my cards...does anything look odd"

          Hosting
          Server Environment: linux/apache
          Default Technology: php5
          Other Enabled Technnologies: CGI/Pearl/Python, ASP 5.6, .NET 2.0,3.0,3.5
          Database: MySql

          Site Structure
          /assets/
          /connectors/
          /core/
          /cron/
          /library/
          /manager/
          /tmp/
          .htaccess
          .config.core.php
          ht.access
          web.config

          Note: I need the .net technologies enabled because the site was formerly a .aspx site. Rackspace allows both technologies to be run, and In order for the server to render any .aspx page it encounters the service must be enabled. This is a temporary thing, as we will disable this after users are able to update any old bookmark.

          I am using the traditional install of MODx. The "cron" directory holds my cron scripts. The "library" directory holds my 3rd party classes. The "tmp" directory is a catch-all of anything.

          The web.config file needs to be there to handle any .aspx redirect pages that the server encounters. I have asked multiple times if having a .htaccess and a web.config file will cause any problems. They have reassured me it does not.

          Extras
          archivist
          getpage
          getresources
          googlesitemap
          if
          simplesearch
          sitemapfriend
          taglister
          tinymce
          ultimateparent
          wayfinder

          @paulp
          Thank you for your insight! I don’t run anything through a cloud server (yet) I am too intimidated tackle that, so I hang out in the general population and let them manage the server(s). I am not familiar with site 5, but I will visit them.

          Thank you both very much for your responses, I really appreciate it.
            • 28215
            • 4,149 Posts
            Can you say what *specific* versions of PHP/MySQL you’re running?

            And if you’re using any opcode caching, such as APC/eAccelerator/etc?
              shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
              • 7914
              • 137 Posts
              Quote from: splittingred at Jan 27, 2011, 07:22 PM

              Can you say what *specific* versions of PHP/MySQL you’re running?
              PHP: 5.2.13
              MySQL: Client API version 5.0.77

              Quote from: splittingred at Jan 27, 2011, 07:22 PM

              if you’re using any opcode caching, such as APC/eAccelerator/etc?
              I apologize, I don’t really know what those are. I’m going to say no, I’m not.

              However, in reguards to accelerators Rackspace did put this on my .htaccess file:
              #Bypass the Media Accelerator Caching Server with Cloud Sites
              ExpiresActive on
              ExpiresDefault A0
              


              This was because we are forcing SSL and the accelerator does not work with that. - I think I said that right...
                • 7914
                • 137 Posts
                ** UPDATE **
                Just had the same thing happen today. I got a Proxy error (SSL time out) on the site.


                Rackspace: Do you have any long database queries?
                Rackspace: That would severally impact your sites performance.


                Rackspace: So, if you have a query that exceed the 30 sec timeout for that particular server, you’ll get a no suitable nodes.


                Rackspace: Question, will you be able to provide the scripts that you are using so we can replicate your issue?
                Rackspace: Just one that you feel might be the issue.


                Me: ...well, just a few min ago, the site was down - and then it was "fixed" just curios as to what you (or whomever) did to bring it back up
                Rackspace: I have done nothing to correct the issue, just trying to trouble shoot at this point and then the site came up

                They are unable to give me any reason why the site went down other than to check all queries to make sure the connection is getting closed and/or check long executing queries. I find it very strange that the site is able to crash and fix itself without anyone doing anything though.

                I realize the MODx team is unable to disclose clients etc. In the grand scheme of things, I find it hard to believe that my site pulls that much traffic. Has any other "major" site(s) been known to have any problems? Maybe it’s a Rackspace environment that just doesn’t get along with MODx...
                  • 9207 ☆ A M B ☆
                  • 2,475 Posts
                  There are so many variables in the setup you described, even if you left MODx out of the equation completely this would be hard to troubleshoot. Clouds are very difficult to troubleshoot in my experience, and not being load balanced is not good in this scenario. It sounds to me like perhaps the following is happening:

                  Page requests trickle in... hit hit hit
                  Each request gets routed through the roulette wheel and one of 10 (?) servers handles the request
                  But say one of those 10 servers is mis-configured or temporarily slammed by the other sites it has to support, and POOF, it can’t handle the database query fast enough, no matter how optimized it is, it just can’t complete it on time.
                  So... the database query watchdog snips off the connection, causing things downstream to trainwreck.

                  That may be completely inaccurate, but from what you described, that sounds plausible. What I’d do here is construct a plain old PHP / MySQL test page. Have that page run a beefy query on the MODx database -- other than the database, we want to leave MODx out of this completely. Have the page log request times to a log file (just a simple number of seconds it took to complete the request). If it’s possible to get any other information on which server handled the request, include that in the log along with the date/time of the request. Thinking this through a bit more, it’d be really good if you were able to make another file that randomized the request so you could backtrack which server handled it. Something like this:

                  <?php
                  // test.php
                  $x = rand(0,1000000000000000); // or hash the date or something to generate a unique string
                  file_get_contents("test_query.php?x=$x");
                  ?>
                  


                  <?php
                  // test_query.php
                  // start timer
                  // run long query
                  // stop timer
                  // write to log file
                  ?>


                  Then repeatedly hit the test.php page -- you could even set this up as a cron job on you local computer, e.g. wget http://yoursite.com/test.php and let it run every minute for 24 hours or something, then pull your logs. The server should track the page requests by name, so you should be able to figure out which server choked according to the value for $x.

                  That may be completely the wrong approach, but it may be worth trying... for complicated setups like this, you have to come up with a way to simplify the variables so you can test them.
                    • 3749
                    • 24,544 Posts
                    Based on the experiences of another poster who discovered a problem with search engines causing trouble on the site, here are a couple of things to try if you haven’t done them already:

                    1. Add a proper robots.txt file.
                    2. Make sure your error (page not found) page is not the same as your home page.

                    They may not help at all, but can’t hurt anything.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 7914
                      • 137 Posts
                      @Everett - Thank you! I even if it has no impact, I am going to run some tests like the example you provided just for my own knowledge. I appreciate your post/time.

                      @BobRay - I will make sure I have a correct robots file. I believe I have one but I will double check. I do have a specific error page set up. Thank you for your time!

                      Somewhat unrelated - I very much appreciate everyone’s input. I hope this thread doesn’t come across as a negative towards MODx, or a please fix this for me. I mainly just wanted to establish a discussion about what is happening. Perhaps this thread will come in handy if anyone in the future experiences this with Rackspace (or any other host) there is some discussion to look at.

                      I am very seriously going to consider moving to a dedicated environment for this site. My other thought is that there is another site(s) who we share this cluster with that is very slow for whatever reason. If that site (that does not belong to me) is pulling a lot of resources, that could cause my site to run poorly. That could explain how the site is awesome for weeks, then dies, then magically fixes itself within a few minutes. - Amazing! smiley