Hi all,
We've just launched a new site for a client and due to the requirements of having to host it in the UK we're using Rackspace's Cloud Servers and Cloud Database instead of ModXCloud.
The site isn't that well trafficked with only 500 visits a day, so the first server we set up only had 1 CPU and 512MB of memory (Ubuntu 12.04 LTS, nginx 1.3.12, PHP 5.3.10, PHP-FPM).
We found that when we had approx 10 concurrent users the load on the site would be too much and people would start experiencing issues accessing the site and all our alerts would start going off. Looking at what was happening to the resources we saw that the CPU was running at 100% constantly, although the memory wasn't being maxed out.
We tried adjusting the server settings to see if we could make a difference but nothing we tried helped.
We've ended up moving across to a server with 4 CPUs and 512MB of memory and this seems to cope with the level of traffic it gets.
Is ModX that CPU intensive? Are there things we can do to improve this, we've already enabled caching on the site?
We have another site launching with this client in the summer and that one gets 8000 visits a day, which makes me worry whether ModX can handle it.
Any thoughts would be welcomed
Thanks
-
☆ A M B ☆
- 24,524 Posts
As far as MODx being able to handle that kind of a load, consider that this forum is a native MODx application, running on Revo, and if you check the stats at the bottom of the page you can see it has had 23232 visitors so far today.
-
MODX Staff
- 730 Posts
The amount of CPU MODX is using depends on how your templating is structured, and on how any Extras or custom code are behaving. For example, if you've got a bunch of TVs in a template, and you're aggregating a number of resources that use that template (e.g. Wayfinder or getResources), and processing those TVs (not just loading their raw values) then this can lead to a lot of CPU usage due to extra database queries and extra work PHP has to do. Also, 'enabling caching' is a little unclear. Beyond just turning on caching and making Resources cacheable, careful consideration of how elements are cached or not can go a long way.
Also, check out these system settings:
http://rtfm.modx.com/display/revolution20/access_category_enabled
http://rtfm.modx.com/display/revolution20/access_context_enabled <-- don't set this one in System Settings .. only turn off in Context Settings
http://rtfm.modx.com/display/revolution20/access_resource_group_enabled
Do you have database caching turned on?
If you post an example of one of your templates, we can see if there are any obvious problems. That level of traffic is nothing for modx to worry about.