Quantcast
Channel: NBStore Discussions Rss Feed
Viewing all articles
Browse latest Browse all 4081

New Post: NB Store Cart table grows

$
0
0
As promised, a summary after monitoring the site and its db for a couple of days.


Issue:
The cart table were growing and the scheduler failed when trying to clean it up.
Resulting in the db getting filled up with unused carts, causing the site to become unstable and eventually fail.


Here's what I did:

1. Create a scheduled run to clean out the cart table for old carts.

1.1
The scheduled run was created to run once a day and with a retry delay of 1 hour:
Image

1.2
With these settings:
Image


2. Manually remove the old carts thru MSSQLSMS.

2.1
In MSSQLSMS i ran this SQL Query:
DELETE FROM dbo.[NB_Store_Cart] 
WHERE DateCreated < dateadd(minute,(15000 * -1),getdate()) 
AND PortalID = 0 
As the cart table had more than 700,000 rows in it, the transaction log for the db filled up while deleting the excessive ones (little more than 600,000 rows).
To get around that, I lowered the tolerance for the "DateCreated" value used in the selection of records, by raising the number 15000 to 150000 and then run the script, lower the number by 30000, run the script again and keep repeating that until I reached 15000.


Conclusion:
After manually removing the major part of unwanted records from the cart table, the transaction log didnt fill up no more, allowing the scheduler to do its job without failing.
It now runs as planned, preventing unwanted excessive growth of the cart table.



Thx for all the inputs in this thread. :-)

Viewing all articles
Browse latest Browse all 4081

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>