Iank1968 Posted February 23, 2009 Share Posted February 23, 2009 here is the code $credit_time = 3*60*60; // how often should we give logon credits (secs) $credit_amount = 2500; // the number of cents we give if they logon after that interval $static_update = 300; // updates every 5 seconds the updates every 5 seconds, would that bog down the server and cause a major bottleneck? can I get rid of it? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/ Share on other sites More sharing options...
The Little Guy Posted February 23, 2009 Share Posted February 23, 2009 maybe, how are you using it? Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769636 Share on other sites More sharing options...
Iank1968 Posted February 23, 2009 Author Share Posted February 23, 2009 im using it to refresh for logins. if 200 people are updating every 5 seconds would that make the server go huh and quit? lol Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769639 Share on other sites More sharing options...
The Little Guy Posted February 23, 2009 Share Posted February 23, 2009 I still don't know what you mean, could you give a little more detail? Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769641 Share on other sites More sharing options...
trq Posted February 23, 2009 Share Posted February 23, 2009 This would depend entirely on your server. Question is way too vague to answer I'm afraid. Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769642 Share on other sites More sharing options...
Iank1968 Posted February 23, 2009 Author Share Posted February 23, 2009 I am new to PHP so please forgive me. I assume the static updates updates the players profile every 5 seconds to receive login credits which they only get every 3 hours. I did bump it up to 200 and everything is running ok. When several people where on and playing the app crashed, it hasnt done that since I bumped it to 200. What I want to know is can I get rid of it? is it a nessesary function? again please forgive me if im not making a whole lot of sense lol Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769645 Share on other sites More sharing options...
trq Posted February 24, 2009 Share Posted February 24, 2009 I am new to PHP so please forgive me. I assume the static updates updates the players profile every 5 seconds to receive login credits which they only get every 3 hours. I did bump it up to 200 and everything is running ok. When several people where on and playing the app crashed, it hasnt done that since I bumped it to 200. What I want to know is can I get rid of it? is it a nessesary function? again please forgive me if im not making a whole lot of sense lol The code you have posted simply assigns numbers to variables. It doesn't appear to be relevent to your question. We need to see the relevent code where this $static_update variable is used to do these updates you speak of before we can even begin to understand what you are talking about. Moving this to 3rd Party Scripts as it is now obvious this code is not written by you. Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769651 Share on other sites More sharing options...
Iank1968 Posted February 24, 2009 Author Share Posted February 24, 2009 no this script was written by someone else who I cannot get ahold of now. its the only problem im having with this script. I thought it would be an easy solution, boy was I wrong lol. Let me get the rest of the code and post that. Hopefully it will be an easy solution. Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769655 Share on other sites More sharing options...
corbin Posted February 24, 2009 Share Posted February 24, 2009 You could store user states in a database and run a cron script. It could clean inactive data automatically and then increment an online counter accordingly. What was probably killing your server earlier was either the number of threads required to respond to that many open connections, or a KeepAliveTimeout setting. Or, your code could be intensive and/or badly written. Quote Link to comment https://forums.phpfreaks.com/topic/146607-static_update-question/#findComment-769706 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.