We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1850
    • 8 Posts
    Hello,
    we have made a website using ModX Revolution. After transferring the traffic to the new version of the website, CMS has loaded CPU to 100%. The quantity of entries in the database was constantly increasing and the hard disc was overloaded. we couldn’t find the opportunity to transfer the entries about users’ sessions to cookies instead of sessions id the table of database. CMS can’t cope with the traffic of 30K visitors daily. it’s very few. what can you suggest to us?


    Modx Revolution 2.0.4-pl2 traditioanal
    Server - Apache/2.2.9 (Fedora)
    System Linux Fedora
    PHP Version 5.2.6
    MySQL server: 5.0.45, client: 5.0.45
    pdo_mysql installed
    CMS uses getResourses, getPage, GetCache.


    Error log:
    Error preparing statement for query: SELECT `modSession`.`id` AS `modSession_id`, `modSession`.`access` AS `modSession_access`, `modSession`.`data` AS `modSession_data` FROM `modx_session` AS `modSession` WHERE `modSession`.`id` = ? - Array ([0] => 00000)
    Error preparing statement for query: SELECT `modSnippet`.`id` AS `modSnippet_id`, `modSnippet`.`name` AS `modSnippet_name`, `modSnippet`.`description` AS `modSnippet_description`, `modSnippet`.`editor_type` AS `modSnippet_editor_type`, `modSnippet`.`category` AS `modSnippet_category`, `modSnippet`.`cache_type` AS `modSnippet_cache_type`, `modSnippet`.`snippet` AS `modSnippet_snippet`, `modSnippet`.`locked` AS `modSnippet_locked`, `modSnippet`.`properties` AS `modSnippet_properties`, `modSnippet`.`moduleguid` AS `modSnippet_moduleguid` FROM `modx_site_snippets` AS `modSnippet` WHERE `modSnippet`.`name` = ? - Array
    (ERROR in xPDO::connect @ /home/webuser/helloworld/htdocs/core/xpdo/xpdo.class.php : 318) SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ’/var/lib/mysql/mysql.sock’
      • 22303 MODX Staff
      • 10,725 Posts
      Try using the cache_database setting (bonus if you can configure it to use a memcached server or two) and see if that doesn’t reduce the database load immensely...it will cache the sessions appropriately.
        • 24531
        • 213 Posts
        OpenGeek,

        what about session_handler_class? If i set it to blank it also should decrease db load, right?
          • 22303 MODX Staff
          • 10,725 Posts
          Quote from: rav3n at Oct 31, 2010, 09:20 AM

          OpenGeek,

          what about session_handler_class? If i set it to blank it also should decrease db load, right?

          Maybe, but I don’t recommend it without testing. Revolution is intended to use the default database session handler class or a custom one that you provide. And as I said, the load should be significantly reduced, including on sessions, with cache_database enabled.
            • 1850
            • 8 Posts
            Caching Handler Class in Caching Options and Session Handler Classname had switched to null, but it didn’t help. Hard disk load decreased by 60%, but CPU load - still 100%. One query to db uses 11% CPU
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: Anvold at Nov 01, 2010, 05:04 AM

              Caching Handler Class in Caching Options and Session Handler Classname had switched to null, but it didn’t help. Hard disk load decreased by 60%, but CPU load - still 100%. One query to db uses 11% CPU
              That sounds like you have some kind of issue with your server or your site implementation then, tbh. If you enabled the cache_database, you should not be seeing any queries, unless you aren’t caching all of your Snippets. In which case, that would be a problem for a high-traffic site. Also, I would not touch the Handler Class settings unless you are either configuring memcached servers to cache to or providing your own handler class implementation( s ).

              For one, I would upgrade PHP (either latest 5.2.x or preferrably 5.3.x, which has some incredible improvements in connection times via PDO) and make sure you are using an opcode cache with plenty of memory to keep all of the classes in memory. I’m running 5.3.3 and testing APC and eAccelerator locally and seeing a huge improvement in performance from both.
                • 176
                • 1 Posts
                I’m having some trouble with traffic lately too. But I dont think its on modx revolution’s side, mostly on the server’s. Anvold, what was the previous "version" of your site, what did it use? Did you already have 30K visitors then? If not, then you need to optimize server settings. eAccelerator and the newest php are certainly good options - you may also want to look into mod_php, fastcgi and my.cnf readd/join buffer settings. Its best if you contact your server’s customer support about this unless you’re well versed in such matters.