We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18373 ☆ A M B ☆
    • 3,141 Posts
    "Normal" websites and projects can be static, or have a simple mysql connection.

    PDO (and xPDO) is an extra layer between the MySQL server, and what is being outputted. By using PDO you are using "Object Oriented Programming" - which means you are thinking about objects (and objects which are related to certain objects) instead of tables, rows and databases. This abstraction also makes it possible to move over to different platforms (mssql, monodb or whatever, really) by building schemas and classes - the link between the objects and its actual representation in the database.

    Because you’re coding on Objects, and not in SQL queries you can more easily make advanced and customized queries.. like this: http://www.shawnwilkerson.com/xpdo/using-xpdo-across-tables/xpdo-newquery-innerjoin.html


    As you’re using an extra layer in between the query and the result, this will obviously add some overhead and is a little slower then regular queries. Add in that (because of the extra layer) you get the chance to cache the output and you limit the overhead somewhat. smiley
      Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

      Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
      • 3186 ☆ A M B ☆
      • 279 Posts
      Does anyone know what the best software versions (like PHP & MySQL) are to run MODx Revolution on?

      I saw that every PDO request takes much more time then ’normal’ procedures or normal queries. I think it’s in PDO but could not find why... I hope someone knows more about this
        MODX Ambassador (NL) & Professional MODX developer
        Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
        MODX e-commerce solution SimpleCart
        • 12372
        • 44 Posts
        I was just reading over this thread in some more detail as I was finding the Revo admin to be rather slow.

        Looking at the demo site of Revo I find that also to be rather slow... so I guess (at least in my case) it could indicate problems with internet connection speed, or a slow computer. (Although I found it to be pretty slow at home too on my 50Mb connection and this computer isn’t that slow at dual core 2.53GHz with 4GB of RAM). I find Chrome is better than my Firefox though on the test version, but no real difference on my own website. So rather confusing.
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: bertoost at Feb 21, 2011, 12:58 AM

          Does anyone know what the best software versions (like PHP & MySQL) are to run MODx Revolution on?
          Latest PHP 5.3, latest MySQL 5.1 are best in my experience.

          Quote from: bertoost at Feb 21, 2011, 12:58 AM

          I saw that every PDO request takes much more time then ’normal’ procedures or normal queries. I think it’s in PDO but could not find why... I hope someone knows more about this
          Where do you see this? I have never experienced a query taking any more time than the equivalent using the mysql extension. huh
            • 3186 ☆ A M B ☆
            • 279 Posts
            Quote from: OpenGeek at Feb 22, 2011, 04:21 PM

            Quote from: bertoost at Feb 21, 2011, 12:58 AM

            I saw that every PDO request takes much more time then ’normal’ procedures or normal queries. I think it’s in PDO but could not find why... I hope someone knows more about this
            Where do you see this? I have never experienced a query taking any more time than the equivalent using the mysql extension. huh

            I have done some debugging to print a execution time in core files, started at the initialize() method wich is called in the index.php and after every database request I saw the seconds are increased much more then when finished a foreach or large part of code. So something is in the PDO requests I think... I don’t know why the software is slow so thats why I was searching...

            Note; when I wait on the page to load I saw a ’sleep’ in the mysql proces list, I don’t know why but the time the sleep is there the page isn’t showing anything. After te sleep is gone, the page is there in a wink...

            I also tried Evolution and that one loads very fast... So after the message of Shaun (before) I think our server isn’t ready for Revolution, but don’t know why because the software on it isn’t very old or something...
              MODX Ambassador (NL) & Professional MODX developer
              Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
              MODX e-commerce solution SimpleCart
              • 3186 ☆ A M B ☆
              • 279 Posts
              I have also an test-account at Site5 (one of MODx promoted hosters) and I was wondering if you would take a look at it? If you would; send me a PM so I could send you the details
                MODX Ambassador (NL) & Professional MODX developer
                Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
                MODX e-commerce solution SimpleCart
                • 3186 ☆ A M B ☆
                • 279 Posts
                I have installed a new local server on Debian, with Apache2, PHP5.3.3-7 and MySQL 5.1.49. MODx is also running slow on this configuration.

                That’s why I made a simple piece of code to create the cache again. For a webshop project in MODx (with +/- 1800 pages) we do every night an live-update of the products etc. (with a connection with the ’real’ stores pay-desk machine). After the update (new products, updated products etc.) and something was updated, I clear the cache and rebuild it with this code. This could also be used as plugin on the clear-cache event.

                foreach($modx->aliasMap as $alias => $resourceId) {
                	$url = $modx->getOption('site_url').$alias;
                	if(get_headers($url) !== false) {
                		//print_r($url.' => INDEXED!'."\n");
                	}
                }


                After this all pages are fast again smiley this is for now my solution. I hope you could do something with it!

                Regards, Bert
                  MODX Ambassador (NL) & Professional MODX developer
                  Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
                  MODX e-commerce solution SimpleCart
                  • 21838
                  • 284 Posts
                  Sounds good for MODX 2.0.x users who have these problems. Just a note: in MODX 2.1 the caching system is vastly improved…
                    MODX Free Template Base: MODX-Boilerplate | my blog (lots of MODX stuff) | my gitHub (translations) | MODX User Groups Germany (Facebook)
                    • 3186 ☆ A M B ☆
                    • 279 Posts
                    @smooth-graphics
                    Is this solving the problem? I have strongly the idea that the installation isn’t slow because of bad cache writings or something like that, but that PDO is running slow.. I did some time-prints all-over in modx-core files and there where the times between 2 prints is much greater there are PDO calls done.
                      MODX Ambassador (NL) & Professional MODX developer
                      Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
                      MODX e-commerce solution SimpleCart
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      2.0.8 also solves a critical cache bug. Not sure if you tried that release as well?
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.