1

I am developing on a high performance MediaTemple DV at the moment. The RAM on the server is 16GB and while pages load relatively quickly, it appears that any scripts I write which use the Channel Entries API, or in fact any channel entries loops that I include, whether they be directly embedded in the template, or called via ajax, tend to max out the CPU. For example, calling a couple of hundred channel entries, with each entry consisting of less than 40 fairly standard fields (with the exception of a small few specific items), set the CPU on the server to be over 100%. Has anyone else experienced a similar issue with channels, entries, the API itself, etc? Our system relies very heavily on calling and filtering channel entries so the current performance is definitely unacceptable.

Any input would be greatly appreciated.

6
  • Are you talking about the API for building add-ons, or just the channel entries tag? Jan 28, 2013 at 18:24
  • If using the channel entries tag, what are you doing within the tag's loop? Embeds? Add-ons? Lots of complex conditionals? What are running on each pass that might also be CPU-intensive? Jan 28, 2013 at 19:14
  • I am talking about both cases, I guess. I am experiencing a massive CPU spike each time my web app seems to either call any custom addons that I have developed which interact with the Channel Entries API, or when I use the channel entries tag loop to produce a set of results on my UI. Jan 28, 2013 at 19:28
  • Have you turned on Template Debugging to see what SQL Queries are being run in your loop? Jan 28, 2013 at 19:32
  • Yes, can you clarfy what you're talking about here? The Channel Entries API is completely divorced from Channel Entries tags - it's the API for creating and updating entries programatically, not for displaying them. But you also mention Channel Entries loops and "embedding" in the template. Can you be more specific? Jan 28, 2013 at 20:52

2 Answers 2

2

You need to be aware sometimes that when using the API, you're going to take a whole lot of potential baggage with you - a lot of that baggage may not be from first party. There are several extension hooks being called when you save an entry.

I've been bitten for example by Solspace Tag doing a whole bunch of cleanup/recounts after ANY entry is created or updated. So, if you're bulk importing fairly simple entry data, there is potential for a lot of complex things to be happening that you're not immediately aware of.

In my case, each entry was taking several seconds to update and Tag was the culprit.

I ended up placing echo statements throughout the entire 'save' entry process in Api_channel_entries which showed me memory usage and time taken to get to various points from submit to save.

There are also some other bulk actions EE can take when saving an entry, like clearing caches and recompiling relationship data (that can be a huge one and thinking now it might be the culprit) but debugging your way through Api_channel_entries is the only way to go imo.

1

In some cases, it is much more efficient to make a direct SQL query instead of calling API. Try making requests that would load only data that you need, instead of trying to get everything via API.

I would also suggest that you post this issue to official EE support forums, as there's a chance there's some EE bug involved here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.