To prevent locking issues and general db clogging. Any table that stores
votes or hits or anything that may do several transactions / second...
INSERT the data into a temporary table, and then put in a cron job which
will UPDATE your actual table with a count of whats in your temp table.
So for instance.
hit.php should execute
INSERT INTO hits_temp VALUES ('/index.html');
or better yet an index of the page, make sure to have a table that explains
what page #1 is
INSERT INTO hits_temp VALUES (1);
then make a cron job which does
$hits = SELECT count(hits) FROM hits_temp WHERE page = 1;
UPDATE hits SET hit_count = hit_count + $hits WHERE page = 1;
This became life of death for our Sun 250 when it tried sustaining 6-8
updates / second on a bit more complicated table. Oracle just seized up,
150 processes got in waiting behind it and then denied connections until it
was restarted. - Russ
-----Original Message-----
From: SED [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 5:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Expert advice needed
Hi,
I'm doing a polling side and I'm wandering what way I should save the
result, should I save each record in MySQL or should I save only the
total value in a text file each time I get vote? So, can anyone of you
experts advice me what way I should go? The traffic is only 100-500 hits
per day.
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is
------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]