Interesting problem (Flash, PHP, JavaScript, others?)
Posted: Tue Dec 06, 2005 2:25 am
Hello all.
I have a seemingly simple problem, but it seems to have turned out to be quite the challenge. I need to keep track of how many people have connected to a server. This will be done from a flash file, using php and such, but that's really irrelevant. Basically, I need to have a MySQL query when the user connects (easy) and a MySQL query when the user finishes the download (again, easy). The problem comes when you consider the amount of users that will close a window, or (and this part removes the possibility of using onUnload), the users browser crashes.
The only way I can think of is having a page that scans through all active connections and disables one that have been open longer than X (in the database, the connection will remain). Unfortunatly, this is simply not feasible due to the fact that this site will have to scale up to at least 5,000 users at peak, with a possibility of 3 or 4 times that number in the case of Slashdotting etc.
I may be approaching this from the wrong way, and if you can come up with an alternative, please let me know. The ideal situtation will use PHP, MySQL, JavaScript or others, but no server-side installs can be done (no cron jobs, etc).
Thanks a lot for reading (I know, it was long, sorry). Any help is GREATLY appreciated - I've been wracking my brains over this one.
I have a seemingly simple problem, but it seems to have turned out to be quite the challenge. I need to keep track of how many people have connected to a server. This will be done from a flash file, using php and such, but that's really irrelevant. Basically, I need to have a MySQL query when the user connects (easy) and a MySQL query when the user finishes the download (again, easy). The problem comes when you consider the amount of users that will close a window, or (and this part removes the possibility of using onUnload), the users browser crashes.
The only way I can think of is having a page that scans through all active connections and disables one that have been open longer than X (in the database, the connection will remain). Unfortunatly, this is simply not feasible due to the fact that this site will have to scale up to at least 5,000 users at peak, with a possibility of 3 or 4 times that number in the case of Slashdotting etc.
I may be approaching this from the wrong way, and if you can come up with an alternative, please let me know. The ideal situtation will use PHP, MySQL, JavaScript or others, but no server-side installs can be done (no cron jobs, etc).
Thanks a lot for reading (I know, it was long, sorry). Any help is GREATLY appreciated - I've been wracking my brains over this one.