This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Questions about swap and database maintenance

At about 18:40 yesterday evening, with no one connected via VPN, and no one in the office, something caused the memory use to decrease and the swap usage to increase (image attached).

Recently, one of the folks from Astaro said that that was what a database maintenance run looks like, so I checked the System log:
2009:07:30-18:40:01 post /usr/sbin/cron[25683]: (root) CMD (   /usr/local/bin/reportcontrol.sh)

2009:07:30-18:40:01 post /usr/sbin/cron[25685]: (root) CMD (/usr/local/bin/adbs-maintenance.plx)
2009:07:30-18:40:01 post adbs-maintenance[25685]: starting ADBS maintenance run
2009:07:30-18:40:01 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'accounting_archive' column name: 'flow_start_day' threshold_day: '733438')
2009:07:30-18:40:05 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / accounting_archive
2009:07:30-18:40:05 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'pfilter_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:08 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / pfilter_archive
2009:07:30-18:40:08 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'auth' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:08 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / auth
2009:07:30-18:40:08 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'imp2p_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:08 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / imp2p_archive
2009:07:30-18:40:08 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'ips_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:08 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / ips_archive
2009:07:30-18:40:08 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'mailsec_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:11 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / mailsec_archive
2009:07:30-18:40:11 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'websec_au_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:11 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / websec_au_archive
2009:07:30-18:40:11 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'websec_aud_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:11 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / websec_aud_archive
2009:07:30-18:40:11 post adbs-maintenance[25685]: Operating on database: 'reporting' (table name: 'websec_bud_archive' column name: 'dayabs' threshold_day: '733438')
2009:07:30-18:40:11 post adbs-maintenance[25685]: finished ADBS maintenance on reporting / websec_bud_archive
2009:07:30-18:40:11 post adbs-maintenance[25685]: cleaning anonymizing mappings
2009:07:30-18:40:59 post adbs-maintenance[25685]: finished ADBS maintenace run

-1- I thought these were supposed to occur at 2AM, so why is my 7.404 Astaro running it at 6:40 and 18:40?

-2- Why didn't the 6:40 run cause everything swappable to be moved out to the swap file?  And, why did the 18:40 run only begin to cause swapping on Tuesday (7/28) after weeks without so doing?  This indicates to me that some space in the swap is not being released and/or swapped back in when the database maintenance is finished.

Cheers - Bob


This thread was automatically locked due to age.
  • 1. The database table rotation is at 2 am. The maintenance is 0640 and 1840 hrs. On console/ssh run cat /etc/crontab and it will show you the times.

    2. Memory management is tricky issue with the linux kernel. That is why there are numerous posts about swappiness. The database maintenance scripts needed some extra memory and the kernel decided to swap something out to the hard drive. The kernel is really efficient therefore once it swaps something out and frees up some ram, why waste more time to recover that swapped space. Leave it on the disk unless needed again. 

    On servers, a little swapping is not going to hurt anything. Look at top and keep an eye on your %wa. If it stays close to zero most of the time, then hard drive is not your bottle neck and you shouldn't loose hair over it. There are many tools to check disk IO just google it. I use vmsat -D once in a while.

    Hope I made some sense[;)]
  • Thanks, Billybob, I've been following those, and I was just confused that I would see this phenomenon at those times.  I hadn't separated the rotation and maintenance in my mind, but I get it now.  I'm not so worried about it - I just misinterpreted the situation as implying a bug, and it doesn't, as you explained.  I suppose that it's to be expected that there are items that get swapped out that aren't used again, and that that's what causes the gradual build-up.

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • This phenomenon has disappeared in V7.500.

    Good job Development Team!

    Cheers - Bob
     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA