Express objects painfully slow
Permalink 1 user found helpful
V8.4.2
I'm finding Express object to be unusuably slow, getting 30 sec PHP timeouts when deleting 6 express entries then adding another 6 in the same web page load. These entries have about 40 attributes each, all text, checkboxes, images and dropdowns and a date.
Here's what the script does...
1. Reads the option list for three of the dropdowns to output in the page
2. Looks for a $_POST of update/creation data, update doing the most work
2a. update will find the entry(ies) by the id ref then loop through deleting them. Then with the new POSTed data will create however many new entries are required, up to 8
3. Checks for a $_GET id value then retrieves all entries with that id value in the courseid attribute (up to 8 entries)
So essentially the most work it does is to read some dropdown options, delete 8 entries, create 8 entries and read these new updated/whatever entries back for output to the web page.
The total number of course on production machine is about 800 with between 1-8 express entries each but here, locally, on the dev version there's maybe 10 courses if that and I'm getting this 30sec timeout on a Ubuntu Bionic 2-4GHz 8Gen Corei7 16GB SSD laptop which imho shouldn't be happening.
So assuming I'm not doing anything wrong (don't see how, it's all C5 calls) are Express Objects super-inefficient for more than the most basic of basic storage work?
I'm finding Express object to be unusuably slow, getting 30 sec PHP timeouts when deleting 6 express entries then adding another 6 in the same web page load. These entries have about 40 attributes each, all text, checkboxes, images and dropdowns and a date.
Here's what the script does...
1. Reads the option list for three of the dropdowns to output in the page
2. Looks for a $_POST of update/creation data, update doing the most work
2a. update will find the entry(ies) by the id ref then loop through deleting them. Then with the new POSTed data will create however many new entries are required, up to 8
3. Checks for a $_GET id value then retrieves all entries with that id value in the courseid attribute (up to 8 entries)
So essentially the most work it does is to read some dropdown options, delete 8 entries, create 8 entries and read these new updated/whatever entries back for output to the web page.
The total number of course on production machine is about 800 with between 1-8 express entries each but here, locally, on the dev version there's maybe 10 courses if that and I'm getting this 30sec timeout on a Ubuntu Bionic 2-4GHz 8Gen Corei7 16GB SSD laptop which imho shouldn't be happening.
So assuming I'm not doing anything wrong (don't see how, it's all C5 calls) are Express Objects super-inefficient for more than the most basic of basic storage work?
Out of interest, did you develop any theories as to the cause of the poor performance?
I really love the idea of Express, in the same way that I love being able to use attributes, but I've not jumped into using them yet myself.
I really love the idea of Express, in the same way that I love being able to use attributes, but I've not jumped into using them yet myself.
Every data item is an attribute. Each attribute requires database operations for key and value. Select attributes also have to work with a secondary table of values. Writes are expensive and made more so by foreign keys and dependencies. Multiply by 40 attributes. Multiply by 6 records deleted plus 6 records added.
Compare that to deleting 6 rows of a single table in one statement. Then adding 6 rows to the table in another statement. No foreign keys or dependencies to slow down the writing.
Compare that to deleting 6 rows of a single table in one statement. Then adding 6 rows to the table in another statement. No foreign keys or dependencies to slow down the writing.
Won't ever use Express again for any meaningful storage. I hope folks thinking about using Express for 'core data storage' type purposes read this before they start building...
It has its uses (I still use it for user-definable email content, etc), but not where any semblance of performance is required.