Hy, i use Modx with xPDO and i love it. But i see that xpdo needs longer and more cpu to get my results as mysql. I made a test from inside modx i created a snippet that give me some results from my db, and the same as select under mysql. my page trow a memory error with xpdo after 10-15 seconds. But mysql give me the results in less then a second. What can i do to geht xpdo faster and use less CPU powser. My complete page needs much cpu power with site cached and a lot with site cached. There is no difference if xpdo is cached or not.
Is there something to calculate the speed of modx? I think i have seen some code i could insert into my page that will show me the time for php and mysql to generate the side but i can not find it anymore, cn someone help me?
Thanks
Ok after testing some sites i get this results on different sites.
MySql: 0.0000 s s, 0 request(s), PHP: 3.0543 s s, total: 3.0543 s s, document retrieved from database
MySql: 0.0000 s s, 0 request(s), PHP: 2.9014 s s, total: 2.9014 s s, document retrieved from database
MySql: 0.0002 s s, 1 request(s), PHP: 1.1549 s s, total: 1.1551 s s, document retrieved from database
MySql: 0.0065 s s, 2 request(s), PHP: 7.4073 s s, total: 7.4138 s s, document retrieved from database
MySql: 0.0036 s s, 2 request(s), PHP: 3.2129 s s, total: 3.2165 s s, document retrieved from database
A site with a clean template needs 10% of Server CPU, thats to much.
My snippet run in less than 0.1 second.
My database is not as big as other sites of me it hast on site_content 48.728 Rows and site_tmplvar_contentvalues 200.952. Is that to much for modx??? Like i said on other page of me i have the count of rows but it runs with less CPU Power.
The biggest problem for me is that my Server CPU is going to 90% if i open an uncached site and 20-25% on cached sites. The Server runs Centos6, PHP 5.3.2 with APC, Mysql 5.1.52 with 2.6Ghz and 4GB Ram. Other applications i wrote with a lot of more pages and bigger databases are generatet in less then a second and cpu of 0.6%. That was before Modx and now it need much more power? How can i handle it? Has anyone an idea? Fast CGI has the same CPU Problem.
Servers are not my strong point so someone else will have to chime in. But I'm really interested.
Also - I wouldn't say that nearly 49k rows is 'too much', but it is certainly a lot. Do you need to store your data in resources or could you look into some custom tables instead?
-
MODX Staff
- 10,725 Posts
First of all, what version of MODX are you running? And what are you benchmarking? The queries executed through xPDO take no longer than queries through the mysql extension, so this is not the issue. You having almost 50,000 Resources certainly could be though and we can explore how you can better scale your site when you are managing this many Resources.
FWIW, if you have not upgraded to a MODX 2.1.x release, you will have performance issues with that many Resources.
That is for the complete Site not for one single page