LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Visitor tracking in Perl (https://www.linuxquestions.org/questions/programming-9/visitor-tracking-in-perl-311909/)

SiLiCoN 04-11-2005 01:44 AM

Visitor tracking in Perl
 
hey all,

thnx for coming by my post. I am stuck up in a logic rather than code. I just cant find a way out and that's why need your help. Here is what the issue is
We are running a huge protal (like more than 3000000 visitors each day). Now what we want to do is to create a program that would track the number of unique visitors for the site. So i coded a porgram (in perl) that wud place a cookie on the visitors browser and create an entry in the log for the visitor. This cookie has an expiration time of 1 month and so the entry in the log will only be created when the cookie is NOT set in the users browser. After that the porgram sets the cookie in the users browser with an expiration time for a month. So he wont create an entry in the log file till another 30 days (until and unless he clears the cookie or logs in from a diff place or with a diff browser). This is not a concern. The problem is that - there are too many processes running all the time due to the program and the CPU always stays at 0.0% idle. There are other programs in the server too which serve banners and other things ... and they tend to work really slow all together. Now i m trying to fig out a diff way to set the cookies in the users browser so that the number of apache child processes reduces. I couldnt think of anything as of yet. The program has to run thorugh port 80 (through apache). It wud be of great help if you can tell me another way to do it.

Thanks in Advance,
SiLiCoN

born4linux 04-11-2005 02:51 AM

why re-invent the wheel? use awstats:

http://awstats.sourceforge.net/

u can cron it or do a demand based log analysis. read the docs.

SiLiCoN 04-11-2005 04:44 AM

hey born4linux,

thanks for the reply.... what awstats does is, it -parses the log files and generates the reports, so it cant actually track number of unique visitors ... (visitors inside a network???) So i need to set cookies to do it...

Thanks
SiLiCoN

vharishankar 04-11-2005 10:36 AM

Webalizer is a very good website stats tool and it produces graphical charts as well. It can give you the number of unique visits (average per day, total each day, monthly totals and so on) as well as number of hits (non-unique page requests) and a wide variety of other statistics that might interest you.

It's a good tool to monitor your webserver. Try it.


All times are GMT -5. The time now is 01:00 PM.