We are generating an XML file everyday detailing the cartthrob orders for the day. The format of this XML is awkward as it needs to repeat certain content at different points as well as a host of conditionals.
I chose stash to record all the orders, stash the main content along with a couple of nested items for cart variations and all works well until we hit upwards of 50 orders.
The server is set to 256MB and now we're getting Server Gone Away Error: 2006. The client has noted that max_allowed_packet=8M and the entire database is only 4M - so this error could be a false negative ?
Upping the ram suppressed that previous error now we're getting server 500 errors.
I have NFI on how to proceed or what to address. The template is as skinny as I can make it. I tried swapping some initial capture tags with {exp:query} and savings were minimal.
This is the basic concept of the XML template that works fine until 50+ orders are being recorded:
{stash:set_list} //set the list
{exp:channel:entries disable="categories|etc"} //query the orders channel
{stash:first_name} //stash the content
{stash:lastname}
{stash:nested_list}
{order_items} //Grab ordered variations stored in CartThrob matrix
{stash:qty}
{stash:color}
{stash:price}
{/order_items}
{/stash:nested}
{/exp:channel:entries}
{/exp:stash:set_list}
Then we build the XML
<xml>
{exp:stash:get_list} //set above, repeat for each order
<customer>
{first_name}
{last_name}
<order_items>
{stash:get_list:nested} //grab the ordered items
{qty}
{price}
{etc…}
{/stash:get_list:nested}
</order_items>
<somepreviousitem>{first_name}</somepreviousitem>
</customer>
{/exp:stash:get_list}
</xml>
Simplistically what can I try to improve this situation? Is there a way to set a batch of sorts ?
Output profiler doesn't help the XML is a template and the extra code breaks the output. Tried BiopsEE but server is running PHP 5.2.17 and required 5.3 - cant change it.