dlebowski Posted January 21, 2010 Share Posted January 21, 2010 I have an application that runs a mysql query every 2 seconds a user is on the page. When I do a netstat to see my active internet connections, I will some times have one person with over 100. This creates huge load problems on my server (and I have a pretty fast dedicated server) My question is, how can one limit this? Can apache do something? I really need help with this! Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/ Share on other sites More sharing options...
Mchl Posted January 21, 2010 Share Posted January 21, 2010 Do you use persistent mysql connections? Don't. Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999218 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 Thanks for the reply. Are you telling me to run : mysql_close() After each query? Or change something on sql server? What about "mod_limitipconn.c"? Will this help? Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999219 Share on other sites More sharing options...
Mchl Posted January 21, 2010 Share Posted January 21, 2010 How do you connect to mysql? Do you use mysql_connect or mysql_pconnect? Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999220 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 mysql_connect() Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999221 Share on other sites More sharing options...
Mchl Posted January 21, 2010 Share Posted January 21, 2010 Ok. So that's not a problem with persistent connections. You can limit maximum connections MySQL will allow http://dev.mysql.com/doc/refman/5.0/en/user-resources.html but this will make your webpage unresponsive when it hits the limit. Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999224 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 What about "mod_limitipconn.c"? Will this help? Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999226 Share on other sites More sharing options...
Mchl Posted January 21, 2010 Share Posted January 21, 2010 I'm not really experienced with Apache configuration, but from description of this mod it seems it does something else. As I said: no experience, so I might be wrong. Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999228 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 Well, thanks for your time. I have had problems with my script and it's because of the server load. I may have to look at something other than ajax. Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999229 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 One last thing. Other than AJAX, what would you suggest I run server side that updates pretty close to real time? Java applets? Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999235 Share on other sites More sharing options...
RichardRotterdam Posted January 21, 2010 Share Posted January 21, 2010 You might be looking for Comet. Also take a look at this thread http://www.phpfreaks.com/forums/index.php/topic,258102.msg1214978.html#msg1214978 Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999337 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 Comet looks interesting. Not sure why i haven't heard of it before. I am looking for a good example used in conjunction with php. Having a hard time. Do you know of any resources? Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999345 Share on other sites More sharing options...
RichardRotterdam Posted January 21, 2010 Share Posted January 21, 2010 Haven't gotten my hands dirty with Comet yet but this project looks promissing http://www.ape-project.org Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999350 Share on other sites More sharing options...
dlebowski Posted January 21, 2010 Author Share Posted January 21, 2010 Man....That does look good. Thanks, man. I'm going to play with this tonight. Ryan Link to comment https://forums.phpfreaks.com/topic/189276-ajax-server-load/#findComment-999542 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.