php - How to QUE visitors into a Waiting Area on my site -
i have developed web-based online registration system 1 of our clients, using php, jquery , ajax , mysql backend. site sitting on dedicated linux server hosted @ our isp.
the challenge have site crashes , falls on around 2500 people try enter when registrations open. can see hundreds of participants open registration page, , continually hits page refresh. page makes mysql db call , returns button gets clicked on when registration opens.
i have thought off load balancing, not viable @ stage. there way 1 can develop queing system whereby system allows example blocks of let’s 300 people @ time continue or register whilst putting balance of other people in waiting area script displays position person in queue?
hope makes sense?
yes possible, mvp mentioned in comment " expect people patient enough , wait in queue? " . may not idea. still can implement it.
whenever user comes registration page, have following steps:
a) count entries in table (you need create queue table, need make entries each visitor registration page).
b) if total count in queue table equal (say 300) , redirect user waiting page. @ waiting page, can display information his/her position using jquery ajax making calls script count current users etc etc.
c) if total count less (say 300), display registration page user, , make entry in queue table along session id (unique id each user) , time. take time in consideration, because visitors may come , stay on registration page doing nothing. have set time limit (say 10 mins) stay on registration free queue.
d) after user completes registration, delete entry queue table user using session id.
but still remember not idea make visitors wait registration @ site in queue. think should configure server handle thousands of requests easily, , should dedicated server.
my above details idea , give heads how can implement it.
i hope you
thank
Comments
Post a Comment