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’
-
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.
OpenGeek,
what about session_handler_class? If i set it to blank it also should decrease db load, right?
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
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.