eriknuds Posted September 17, 2013 Share Posted September 17, 2013 Hi, I'm pretty new to Prestashop, and I've been experimenting and testing it a bit lately. I like Prestashop a lot so far, but I stumbled upon some strange behavior I'd like to tell you about, and hopefully some of you can comment and shed some light on the situation...using PrestaShop 1.5.5.0 I've been entering some data into the system using the web services, which I eventually will use to build the shop from existing data, and noticing that the web service POSTs when creating a category (my first test) was incredibly slow, even though the GET performance was ok. A GET would typically take about a second, but the POST took about 30-40 seconds! Sure, there is some writing being done on the POST, but a few database inserts and updates should take milliseconds - it was not that...I investigated, and noticed that the apache process was using about 100% of one CPU core during these 30-40 seconds. Using strace (linux) and attaching to the apache process, I saw it repeatedly accessing the same smarty cache pages - a handful of identical requests done over and over probably thousands and thousands of times. I turned off the smarty cache, no change. I cleared the smarty cache, and then the web service POST category took about 1 second! That's ok by me, at least on that setup. Just to have mentioned it, when the smarty cache was causing issues, creating a category using the GUI took even longer than using the web service - which was expected. After clearing the smarty cache, the GUI also took a lot less time to create a category than before clearing the smarty cache. I had shaved off at least 30 seconds from the GUI operation as well. I turned the smarty cache back on, but the problem hasn't reappeared - at least not yet. The only thing I can think of as a reason for a possible cache corruption, is that I recently upgraded the Prestashop (via the GUI upgrade module), and something might have changed in the cache system between the versions. The previous version I ran was a few months old I belive, don't remember exactly - I had installed Prestashop and then didn't have time to play with it much for some time. A few questions comes to mind: 1. Why is smarty needed for web service calls to create a category? 2. What was wrong with my smarty cache? 3. Have anybody else experienced similar issues? Link to comment Share on other sites More sharing options...
stottycabanas Posted September 17, 2013 Share Posted September 17, 2013 Welcome to the forum, eriknuds. Yes, there's a lot to like about Prestashop, but for your question 3 - the answer in my case is yes! When I first installed 1.5.4.1, I was finding that some back office operations, in particular updating category/product/manufacturer/supplier data weren't just taking a long time - they were timing out altogether. Although sometimes you could stop the page load a few seconds after clicking Save, and the update had in fact been made successfully. However, that didn't feel like a reliable method for making changes. I'm not as technical as you and it took me ages to discover the impact of the smarty cache. So now if I want to make back office changes, I will turn the smarty cache off; clear it; make the changes; turn smarty cache on again. Why it has to work that way, God knows - not very merchant-friendly. So I suspect the answer to question 2 is: nothing - your smarty cache is 'normal' Cheers, Dave Link to comment Share on other sites More sharing options...
eriknuds Posted September 18, 2013 Author Share Posted September 18, 2013 Thanks for contributing, Dave! Hopefully more people will add their 2¢ to this as well! The issue might be resolved by Prestashop updating smarty to the newest version, which seem to have changed a lot about the cache system internals and also got rid of a lot of stat calls. The repeated calls reported by strace on my setup was to lstat64 going up/down the smarty cache file system so even if the unnecessary smarty processing isn't totally removed (though it hopefully is) it will likely make much less of an impact using the new version of smarty. Link to comment Share on other sites More sharing options...
eriknuds Posted September 18, 2013 Author Share Posted September 18, 2013 The slow web service (back office) POST issue reappeared now...disabled smarty cache, cleared it, problem went away again...hopefully this will get some attention from the developers in the near future! I can imagine a lot of people being hit by this, without realizing why the backoffice operations seem sluggish... Link to comment Share on other sites More sharing options...
Recommended Posts