RE: [PHP] counter for HIGH traffic site
On Mon, 8 Apr 2002, Matthew Walker wrote: > You definitely want to use MySQL for this. Ignore all those people who > recommended text file DBs. They are /SLOW/. MySQL is very very fast. I'll echo this. MySQL is hyperoptimized for this sort of transaction. It already has the databases open so that you don't have to deal with the overhead of the filesystem locating and opening files. And it solves the locking issues on its own. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] counter for HIGH traffic site
What is wrong with simply using the log files. Seems to me this is a lot of excess overhead for very little data. A low end log analyzer will provide this same info and much more. (and possibly free... such as HTTP Analyze - http://www.netstore.de/Supply/http-analyze/) olinux --- "SHEETS,JASON (Non-HP-Boise,ex1)" <[EMAIL PROTECTED]> wrote: > Make sure you are locking the file if you do this, > > With a high amount of traffic text based counters > don't usually work too > well because you have to deal with contention, what > if two users view a page > at the same time, you will run into a corrupt or > inaccurate number. > > If you do file locking do you display an error > asking them to refresh or do > you handle it some other way? This becomes apparent > especially with higher > traffic sites like he was talking about. > > You may well be best off using a database, either > that or invest some > serious thought into how you are going to handle > multiple clients loading > pages. > > Jason > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 08, 2002 12:56 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] counter for HIGH traffic site > > > If it should be fast, > avoid using mysql, just write a file with your > number, > if there´s a new request, get your number, add one > and write it back. > So you avoid mysql-"SQL parsing", opening Database, > searching data, > send to process, php putting in var... > just open, read, add, write, close > HTH Oliver > At 08.04.2002 14:32, you wrote: > > > >You might also want to setup the table your > updating the hits in > >as a HASH type table which runs completely in RAM, > and as a result > >is extremely fast. The only obvious downside, is > the data (or hits in this > >case) > >are lost on reboot. > > > >Adam Voigt > >[EMAIL PROTECTED] > > > >On Mon, 8 Apr 2002 09:41:39 -0700, Jim Lucas [php] > <[EMAIL PROTECTED]> > wrote: > > > as long as you are only inserting information > into the mysql db on each > > page > > > load, then you shouldn't have a problem. make > sure you keep you > indecies > > > down to a minimum. > > > > > > Jim Lucas > > > > > > - Original Message - > > > From: "Craig Westerman" > <[EMAIL PROTECTED]> > > > To: "php-general-list" > <[EMAIL PROTECTED]> > > > Sent: Saturday, April 06, 2002 11:57 PM > > > Subject: [PHP] counter for HIGH traffic site > > > > > > > > > > I'm needing counter for site that receives 60 > to 80 hits a minute. > Many I > > > > have tried cause excessive server load and > need to be deactivated or > they > > > > lose data and return to zero without warning. > All tried so far have > been > > > > written in Perl. > > > > > > > > Anyone here know of a PHP counter that would > handle HIGH traffic with > > > little > > > > added server load? Would using MySQL to store > count be of any benifit? > > > > > > > > Thanks > > > > > > > > Craig ><> > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: > http://www.php.net/unsub.php > > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] counter for HIGH traffic site
You definitely want to use MySQL for this. Ignore all those people who recommended text file DBs. They are /SLOW/. MySQL is very very fast. To show you a small sample of how fast, here's the debug data from one of my scripts, showing how long the page took to generate, and how many queries were run. The queries consist of the same kind you would be using. Debug Data This page was generated in 0.030305027961731 seconds. 9 queries executed. Matthew Walker Ecommerce Project Manager Mountain Top Herbs -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Saturday, April 06, 2002 11:58 PM To: php-general-list Subject: [PHP] counter for HIGH traffic site I'm needing counter for site that receives 60 to 80 hits a minute. Many I have tried cause excessive server load and need to be deactivated or they lose data and return to zero without warning. All tried so far have been written in Perl. Anyone here know of a PHP counter that would handle HIGH traffic with little added server load? Would using MySQL to store count be of any benifit? Thanks Craig ><> [EMAIL PROTECTED] --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.344 / Virus Database: 191 - Release Date: 4/2/2002 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] counter for HIGH traffic site
Make sure you are locking the file if you do this, With a high amount of traffic text based counters don't usually work too well because you have to deal with contention, what if two users view a page at the same time, you will run into a corrupt or inaccurate number. If you do file locking do you display an error asking them to refresh or do you handle it some other way? This becomes apparent especially with higher traffic sites like he was talking about. You may well be best off using a database, either that or invest some serious thought into how you are going to handle multiple clients loading pages. Jason -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 12:56 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] counter for HIGH traffic site If it should be fast, avoid using mysql, just write a file with your number, if there´s a new request, get your number, add one and write it back. So you avoid mysql-"SQL parsing", opening Database, searching data, send to process, php putting in var... just open, read, add, write, close HTH Oliver At 08.04.2002 14:32, you wrote: > >You might also want to setup the table your updating the hits in >as a HASH type table which runs completely in RAM, and as a result >is extremely fast. The only obvious downside, is the data (or hits in this >case) >are lost on reboot. > >Adam Voigt >[EMAIL PROTECTED] > >On Mon, 8 Apr 2002 09:41:39 -0700, Jim Lucas [php] <[EMAIL PROTECTED]> wrote: > > as long as you are only inserting information into the mysql db on each > page > > load, then you shouldn't have a problem. make sure you keep you indecies > > down to a minimum. > > > > Jim Lucas > > > > - Original Message - > > From: "Craig Westerman" <[EMAIL PROTECTED]> > > To: "php-general-list" <[EMAIL PROTECTED]> > > Sent: Saturday, April 06, 2002 11:57 PM > > Subject: [PHP] counter for HIGH traffic site > > > > > > > I'm needing counter for site that receives 60 to 80 hits a minute. Many I > > > have tried cause excessive server load and need to be deactivated or they > > > lose data and return to zero without warning. All tried so far have been > > > written in Perl. > > > > > > Anyone here know of a PHP counter that would handle HIGH traffic with > > little > > > added server load? Would using MySQL to store count be of any benifit? > > > > > > Thanks > > > > > > Craig ><> > > > [EMAIL PROTECTED] > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counter for HIGH traffic site
If it should be fast, avoid using mysql, just write a file with your number, if there´s a new request, get your number, add one and write it back. So you avoid mysql-"SQL parsing", opening Database, searching data, send to process, php putting in var... just open, read, add, write, close HTH Oliver At 08.04.2002 14:32, you wrote: > >You might also want to setup the table your updating the hits in >as a HASH type table which runs completely in RAM, and as a result >is extremely fast. The only obvious downside, is the data (or hits in this >case) >are lost on reboot. > >Adam Voigt >[EMAIL PROTECTED] > >On Mon, 8 Apr 2002 09:41:39 -0700, Jim Lucas [php] <[EMAIL PROTECTED]> wrote: > > as long as you are only inserting information into the mysql db on each > page > > load, then you shouldn't have a problem. make sure you keep you indecies > > down to a minimum. > > > > Jim Lucas > > > > - Original Message - > > From: "Craig Westerman" <[EMAIL PROTECTED]> > > To: "php-general-list" <[EMAIL PROTECTED]> > > Sent: Saturday, April 06, 2002 11:57 PM > > Subject: [PHP] counter for HIGH traffic site > > > > > > > I'm needing counter for site that receives 60 to 80 hits a minute. Many I > > > have tried cause excessive server load and need to be deactivated or they > > > lose data and return to zero without warning. All tried so far have been > > > written in Perl. > > > > > > Anyone here know of a PHP counter that would handle HIGH traffic with > > little > > > added server load? Would using MySQL to store count be of any benifit? > > > > > > Thanks > > > > > > Craig ><> > > > [EMAIL PROTECTED] > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] counter for HIGH traffic site
You might also want to setup the table your updating the hits in as a HASH type table which runs completely in RAM, and as a result is extremely fast. The only obvious downside, is the data (or hits in this case) are lost on reboot. Adam Voigt [EMAIL PROTECTED] On Mon, 8 Apr 2002 09:41:39 -0700, Jim Lucas [php] <[EMAIL PROTECTED]> wrote: > as long as you are only inserting information into the mysql db on each page > load, then you shouldn't have a problem. make sure you keep you indecies > down to a minimum. > > Jim Lucas > > - Original Message - > From: "Craig Westerman" <[EMAIL PROTECTED]> > To: "php-general-list" <[EMAIL PROTECTED]> > Sent: Saturday, April 06, 2002 11:57 PM > Subject: [PHP] counter for HIGH traffic site > > > > I'm needing counter for site that receives 60 to 80 hits a minute. Many I > > have tried cause excessive server load and need to be deactivated or they > > lose data and return to zero without warning. All tried so far have been > > written in Perl. > > > > Anyone here know of a PHP counter that would handle HIGH traffic with > little > > added server load? Would using MySQL to store count be of any benifit? > > > > Thanks > > > > Craig ><> > > [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counter for HIGH traffic site
as long as you are only inserting information into the mysql db on each page load, then you shouldn't have a problem. make sure you keep you indecies down to a minimum. Jim Lucas - Original Message - From: "Craig Westerman" <[EMAIL PROTECTED]> To: "php-general-list" <[EMAIL PROTECTED]> Sent: Saturday, April 06, 2002 11:57 PM Subject: [PHP] counter for HIGH traffic site > I'm needing counter for site that receives 60 to 80 hits a minute. Many I > have tried cause excessive server load and need to be deactivated or they > lose data and return to zero without warning. All tried so far have been > written in Perl. > > Anyone here know of a PHP counter that would handle HIGH traffic with little > added server load? Would using MySQL to store count be of any benifit? > > Thanks > > Craig ><> > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php