How do you tell if user maintenance is actually running?
How do you tell if user maintenance is actually running?
My ac_Users table is enormous - far more than my web site statistics represent. I don't think user maintenance is cleaning up old anonymous accounts.
How do you tell if user maint. actually ran?
How do you tell if user maint. actually ran?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
Re: How do you tell if user maintenance is actually running?
Maintenance operations are logged in the app.log.
I see entries in my logfile, so I'm presuming it is running.
I see entries in my logfile, so I'm presuming it is running.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: How do you tell if user maintenance is actually running?
Joe, I remember wondering the same about a site because the table had so many users. I just can't remember which one it was now.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
This is correct - App_Data/app.log. And periodically it should report "User maintenance removed 124 expired user records" or something along those lines.WylieE wrote:Maintenance operations are logged in the app.log.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
AHA! Thank you - forgot all about app.log.
Mine's showing that user maint. ran and it cleared x expired anonymous users.
Wonder what it means ".....disabled 3 expired merchant acounts."
Mine's showing that user maint. ran and it cleared x expired anonymous users.
Wonder what it means ".....disabled 3 expired merchant acounts."

Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
There are at least 3 accounts that are assigned to groups that have associated permissions, and those accounts have not been logged into for X months... maybe 6 or 12 depending on your policy.AbleMods wrote:Wonder what it means ".....disabled 3 expired merchant acounts."
There is a known bug where this message keeps getting logged each time maintenance runs even if the accounts are already disabled. It is corrected for the next release.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
Ohhhhhh. Would that would explain my one of my backup login accounts was marked as "disabled" ?
I thought someone was trying to brute-force the login info
I thought someone was trying to brute-force the login info

Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
No... requirement of PCI is that dormant admin accounts be expired. You can increase the timeout up to 24 months from our form, but I can't remember if 6 or 12 is the limit for PCI compliance.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
Shoot I was wrong. PCI DSS v1.2, sec 8.5.5 says: Remove/disable inactive user accounts at least every 90 days. This refers to non consumer (admin) accounts.
Just FYI.
Just FYI.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
Ok think I found my problem.
My ac_Users is showing no less than 734,000+ user records. So something wasn't quite right.
I checked my user maintenance settings and my anonymous days-to-save was set correctly. But I see my affiliate days-to-save was blank, i.e. forever. Since ALOT of my inbound traffic comes from affiliate-coded URLs in Google, this could explain the extraordinarily large user list. I've adjusted the value to 90 days.
I'll monitor the app.log and see if I catch a sudden huge cleansing of the users table
My ac_Users is showing no less than 734,000+ user records. So something wasn't quite right.
I checked my user maintenance settings and my anonymous days-to-save was set correctly. But I see my affiliate days-to-save was blank, i.e. forever. Since ALOT of my inbound traffic comes from affiliate-coded URLs in Google, this could explain the extraordinarily large user list. I've adjusted the value to 90 days.
I'll monitor the app.log and see if I catch a sudden huge cleansing of the users table

Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
You can force maintenance to occur if you restart the web application (e.g. modify the web.config file or reset it in IIS). Maintenance will occur on the first visit. I keep meaning to add a button in the admin so you can trigger it manually - that would probably come in handy here and there.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
Hmmm.
I bounced IIS and it only cleared out another 5,000 or so anonymous users. Something still isn't right.
I see in my app log:
Yet I look in my ac_users table and do a select * from ac_users where isanonymous = 1. It returned hundreds of thousands of records with lastactivity dates in 2008. Here's the result set from a top(10) *:
What's the exact criteria for maintenance to purge an anonymous user? Something's getting missed in my store. My ac_Users table is well over 750,000 records now.
I bounced IIS and it only cleared out another 5,000 or so anonymous users. Something still isn't right.
I see in my app log:
Code: Select all
INFO 2009-09-09 14:23:38,064 187ms Object a - Running maintenance routines
INFO 2009-09-09 15:18:01,173 3263296ms Object a - User maintenance cleared 5653 expired anonymous users, last active before 8/30/2009 6:23:38 PM
INFO 2009-09-09 15:18:01,189 3263312ms Object a - User maintenance disabled 3 expired merchant accounts.
INFO 2009-09-09 15:18:08,829 3270953ms Object a - Payment maintenance cleared 2 expired payments, completed before 9/4/2009 7:18:08 PM
INFO 2009-09-09 15:18:09,783 3271906ms Object a - Page view maintenance cleared 27110 expired records.
INFO 2009-09-09 15:18:10,048 3272171ms Object a - Maintenance routines complete
INFO 2009-09-09 16:26:24,923 140ms Object a - Running maintenance routines
INFO 2009-09-09 16:32:46,829 382046ms Object a - User maintenance cleared 648 expired anonymous users, last active before 8/30/2009 8:26:24 PM
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
For non-affiliate anonymous users:
SELECT UserId FROM ac_Users WHERE StoreId = @storeId AND IsAnonymous = 1 AND AffiliateId IS NULL AND ReferringAffiliateId IS NULL AND (LastActivityDate IS NULL OR LastActivityDate < @expireDate)
For affiliate anonymous users:
SELECT UserId FROM ac_Users WHERE StoreId = @storeId AND IsAnonymous = 1 AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL) AND (LastActivityDate IS NULL OR LastActivityDate < @expireDate)
Does this help?
SELECT UserId FROM ac_Users WHERE StoreId = @storeId AND IsAnonymous = 1 AND AffiliateId IS NULL AND ReferringAffiliateId IS NULL AND (LastActivityDate IS NULL OR LastActivityDate < @expireDate)
For affiliate anonymous users:
SELECT UserId FROM ac_Users WHERE StoreId = @storeId AND IsAnonymous = 1 AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL) AND (LastActivityDate IS NULL OR LastActivityDate < @expireDate)
Does this help?
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
The first query returns 0 records:
That makes sense.
The second query returns 208,000+ records:
I don't get it. It's as if the affiliate anonymous users query isn't getting fired at all. Or....the @expiredate could be getting calculated wrong for that query. It's the only parameter that's dynamic. StoreId couldn't be wrong or all the queries in the storefront would fail.
Any ideas about @expiredate ?
Code: Select all
SELECT UserId FROM ac_Users
WHERE StoreId = 1 AND IsAnonymous = 1
AND AffiliateId IS NULL AND ReferringAffiliateId IS NULL
AND (LastActivityDate IS NULL OR LastActivityDate < 'December 31, 2008')
The second query returns 208,000+ records:
Code: Select all
SELECT UserId FROM ac_Users
WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'December 31, 2008')
Any ideas about @expiredate ?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
After you changed the anonymous user lifespan, when you view app.log, do you see any error about user maintenance failing? I am wondering if it's hitting a timeout because of the number of records.
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
I think you're right.
Look at this, noting the date/time of 648 deleted and the datetime of the failure of the next one. The reason it failed was because I rebooted the server at that time.
If we can assume the affiliate anon purge occurs immediately after the non-affiliate purge, these logs would seem to indicate that the affiliate anon purge was running from approx. 4:30pm until I rebooted at midnight. I'm guessing at this point, but it's indicative the separate-thread process for user maintenance may be running constantly, trying to clean up hundreds of thousands of records one-by-one-by-one.
But still, I only bounce that box every 30 days or so. You would think it would "catch up" eventually, no?
Maybe I need to run some sort of manual mass-delete on ac_users and thin it back down within reason for the maintenance routines to handle on their own again?
Look at this, noting the date/time of 648 deleted and the datetime of the failure of the next one. The reason it failed was because I rebooted the server at that time.
If we can assume the affiliate anon purge occurs immediately after the non-affiliate purge, these logs would seem to indicate that the affiliate anon purge was running from approx. 4:30pm until I rebooted at midnight. I'm guessing at this point, but it's indicative the separate-thread process for user maintenance may be running constantly, trying to clean up hundreds of thousands of records one-by-one-by-one.
But still, I only bounce that box every 30 days or so. You would think it would "catch up" eventually, no?
Maybe I need to run some sort of manual mass-delete on ac_users and thin it back down within reason for the maintenance routines to handle on their own again?
Code: Select all
INFO 2009-09-09 16:32:46,829 382046ms Object a - User maintenance cleared 648 expired anonymous users, last active before 8/30/2009 8:26:24 PM
WARN 2009-09-10 00:16:15,689 28190906ms Object a - Error running SQL: DELETE FROM ac_Users WHERE StoreId = @storeId AND UserId = @userId
System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been ended.)
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected)
at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
at System.Data.SqlClient.TdsParserStateObject.ReadByte()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteNonQuery(DbCommand command)
at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteNonQuery(DbCommand command)
at CommerceBuilder.Data.Database.ExecuteNonQuery(DbCommand command)
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- Logan Rhodehamel
- Developer
- Posts: 4116
- Joined: Wed Dec 10, 2003 5:26 pm
Re: How do you tell if user maintenance is actually running?
It does this to avoid SQL timeouts and also because there is related data that may not be enabled for cascade delete.AbleMods wrote:I'm guessing at this point, but it's indicative the separate-thread process for user maintenance may be running constantly, trying to clean up hundreds of thousands of records one-by-one-by-one.
At an off peak time, back up your database then try this:
Code: Select all
DELETE FROM ac_Baskets WHERE UserId = IN (SELECT UserId FROM ac_Users
WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'December 31, 2008'))
DELETE FROM ac_Wishlist WHERE UserId = IN (SELECT UserId FROM ac_Users
WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'December 31, 2008'))
DELETE FROM ac_Users
WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'December 31, 2008')
Cheers,
Logan
.com
If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Logan

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.
Re: How do you tell if user maintenance is actually running?
Done. ac_Users is down to a clean-and-tidy 210,290 records now. Thanks so much for your tireless efforts Logan. Your depth and variety of knowledge never ceases to amaze me.
Had to modify the code slightly for SQL 2005 Express...here's the final T-SQL commands.(27816 row(s) affected)
(96 row(s) affected)
(271180 row(s) affected)
Code: Select all
DELETE FROM ac_Baskets
WHERE UserId IN (SELECT UserId FROM ac_Users WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'June 30, 2009'))
DELETE FROM ac_Wishlists
WHERE UserId IN (SELECT UserId FROM ac_Users WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'June 30, 2009'))
DELETE FROM ac_Users
WHERE StoreId = 1 AND IsAnonymous = 1
AND (AffiliateId IS NOT NULL OR ReferringAffiliateId IS NOT NULL)
AND (LastActivityDate IS NULL OR LastActivityDate <'June 30, 2009')
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: How do you tell if user maintenance is actually running?
I checked user tables on some of our databases and they all seem to be OK- I thought I had seen one that had a lot of users, but might be remembering wrong.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx