MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: quangnhut123 on 2014-05-25, 02:46:59

Title: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-25, 02:46:59
I do two command
1. sh /script/fixtraffic
2. sh /script/scavenge

Seem to be it do same thing update new bandwidth and disk space metter, domain count , ftp user count.....
What's is different between two command ?
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-25, 03:23:09
Scavenge does a few more things,  I know one of them is to gracefully restart httpd, and something else, I run scavenge once a day and have fixtraffic running every 4 hours.

Not a comprehensive answer, sorry, but they are slightly different.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-25, 03:34:40
Scavenge does a few more things,  I know one of them is to gracefully restart httpd, and something else, I run scavenge once a day and have fixtraffic running every 4 hours.

Not a comprehensive answer, sorry, but they are slightly different.
i saw the scavenge time in kloxo panel. Can i set time to do it automatic here ?
And why run fixtraffic every 4 hours. Both is update metter. 
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-25, 04:45:15
Scavenge time from panel is unpredictable.   Sometimes it does, sometimes it doesn't work.

http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684 (http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684)

Every 4 hours is for shared hosting business, a client can eat up a lot of resources in 4 hours!  ;)  If you only run it once a day, well, I've had client's use gigabytes over their plans.  On my full production servers, I run fixtraffic every 2 hours.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-25, 12:07:02
Okay i understand that but when you run one of them the result is same so why you have to run both 2 command ?
And do you run it by add to cron job in the panel ? Please give me a tutorial ~!
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: MRatWork on 2014-05-25, 12:10:43
I didn't use Scavenge or cronjob for fixtraffic. No issue related to traffic report. Yes, traffic will be updated everyday in default and using Scavenge/fixtraffic will be updated immediately.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-25, 14:29:32
I didn't use Scavenge or cronjob for fixtraffic. No issue related to traffic report. Yes, traffic will be updated everyday in default and using Scavenge/fixtraffic will be updated immediately.
But should we use fixtraffic or scavenge script to update. I just want to know the different
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: MRatWork on 2014-05-25, 15:07:17
fixtraffic only execute gettraffic.php and collectquota.php. But, scavenge ALSO execute schedulebackup.php, clearsession.php and mebackup.php beside other some functions.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-25, 16:12:08
backups, that's the part of scavenge ;)

Now, we have been down this road MANY times.  Scavenge skips days, doesn't always run, idk, I couldn't even find the cron where the panel set it.  Many of us running production shared hosting noticed skips in stats.

Second, resource usage does not magically update!  If you run scavenge once a day, and a client spends all day uploading, downloading, video, whatever, resource limits can and have been abused.  I run a fixtraffic cron to keep client resource usuage up to date (4 hours isn't really up to date, but better than 24!). This is another reason we need quota use in KloxoMR.

that's all.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-25, 17:50:07
backups, that's the part of scavenge ;)

Now, we have been down this road MANY times.  Scavenge skips days, doesn't always run, idk, I couldn't even find the cron where the panel set it.  Many of us running production shared hosting noticed skips in stats.

Second, resource usage does not magically update!  If you run scavenge once a day, and a client spends all day uploading, downloading, video, whatever, resource limits can and have been abused.  I run a fixtraffic cron to keep client resource usuage up to date (4 hours isn't really up to date, but better than 24!). This is another reason we need quota use in KloxoMR.

that's all.
Ah ha in panel do you see Cron Scheduled Tasks . I think it can excute as schedule the command you want. I'm not test but you can try it.
And in your method how to make scavenge run once a day and fixtraffic per 2 hours by crontab via command ?
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-25, 21:11:24
http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684 (http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684)

That is how I did it, follow the link ;)

Just add every 2 hours to complex cron instead of every 4.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-26, 18:11:17
http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684 (http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684)

That is how I did it, follow the link ;)

Just add every 2 hours to complex cron instead of every 4.

Thanks i try to run fixtraffic per hour :) and scavenge per day complete !
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-27, 09:14:22
How to know if ir run success. I enter my email to cron email but no received any yet
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-28, 04:53:56
http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684 (http://forum.mratwork.com/kloxo-mr-technical-helps/error-traffic-not-work/msg30684/#msg30684)

That is how I did it, follow the link ;)

Just add every 2 hours to complex cron instead of every 4.
How to know if ir run success. I enter my email to cron email but no received any yet
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-28, 05:16:16
If you used my instructions from that other post, we piped all output to null, this is so you don't get any email.  If you want email, just enter the command without the pipe to null.

;)
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-28, 09:03:02
If you used my instructions from that other post, we piped all output to null, this is so you don't get any email.  If you want email, just enter the command without the pipe to null.

;)
After run fixtraffic once per hour on my server only have 1 domain added . i download to test traffic and the awstats show me exactly traffic 1.07 GB but the panel show me 21gb BW up to now i have no any domain add to this server and no one use this . this is private server for testing purpose before use !

One more thing i dont understand which is for ?
Goto Domain Mode > Stats Configuration > See check box Remove Processed Logs .

It's show the notice like that. but im not clear about that
    Every day, if the log file's size is larger than 50MB, they are moved into the client's home directory. If you set the remove_processed_logs as true, then instead of moving, they will be deleted. Your main statistics calculation will not be affected at all.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-28, 17:14:17
Interesting, looks like fixtraffic isn't keeping track of what it already processed.  I see minor inconsistency but never like that.

I have been wondering about proxy stats, if the integration with fixtraffic for them was all done, and have been generally concerned about bandwidth stats.  KloxoMR is buggy in some areas.

The process stats is a mystery to me too!  ;)  I have it checked on one server, unchecked on another.  Nothing ever shows up in clients processed logs directory.
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-29, 02:44:03
Now it take me up 33gb and no download is happend. Please help me
Title: Re: What's different with scavenge and fixtraffic command ?
Post by: chrisf on 2014-05-29, 05:06:36
I will try to recreate.  did you FTP the 1g of data?  Could be a bug with FTP bandwidth stats.

Inform here sysinfo (sh /script/sysinfo)
Inform here also the commands you used in cron.

Also try using webalizer instead of awstats.

Title: Re: What's different with scavenge and fixtraffic command ?
Post by: quangnhut123 on 2014-05-29, 10:51:08
I will try to recreate.  did you FTP the 1g of data?  Could be a bug with FTP bandwidth stats.

Inform here sysinfo (sh /script/sysinfo)
Inform here also the commands you used in cron.

Also try using webalizer instead of awstats.
My server only add 1 domain and no one know it. I use ftp to upload only 1 php file to view as my index. And no bandwidth use at any services. Up to now all awstats and webalizer is working properly its show stats for only 1.27gb its true when i try to start download 190mb file test on this domain. And in the client admin show 33gb and still increase after 3 or 4 fixtraffic cron work