jaymc Posted November 26, 2007 Share Posted November 26, 2007 I have made a livechat system that uses ajax to call a php script every 2 seconds that runs 1 query checking a table for chat messages The table will generally only have 100 messages in as I have a cron job that runs every minute to clean dead messages My question is, if ajax is calling a php script every 2 seconds.. is it better to have a mysql concurrent connection, or persistant I think its called If someone could advise the advantages and disadvantages of doing so. I own the server so can do what I like with mysql conf etc if required. Just concerned about mysql getting hammered Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/78935-solved-concurrent-connection/ Share on other sites More sharing options...
subcool Posted November 28, 2007 Share Posted November 28, 2007 remember that you can only have X amount of connections to your server. if you dont use persistent connections it will open a connection, query, close... the chance of going of the max amount of connections in the same milisecond the query is active are slim to none. Persistent connections wil make overhead from connecting smaller, but will increase the chance of getting to the max amount of connections... normal connections do not have this problem Quote Link to comment https://forums.phpfreaks.com/topic/78935-solved-concurrent-connection/#findComment-401091 Share on other sites More sharing options...
jaymc Posted November 30, 2007 Author Share Posted November 30, 2007 Cheers, I went with normal connections Quote Link to comment https://forums.phpfreaks.com/topic/78935-solved-concurrent-connection/#findComment-402589 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.