Jump to content

Recommended Posts

Is looping a page every second or two bad when it calls an SQL Select query to the database? The reason I do this is for an online/offline status check and to output it to the page? I need it in real-time but I'm not sure if this would crash mysql or would be too much of a server load?

 

Thanks,

n3m.

Link to comment
https://forums.phpfreaks.com/topic/114187-looping-a-page-that-queries-a-select/
Share on other sites

Hi,

 

If you're going to do this you really should use some form of query caching, I don't know if MySQL does this automatically.

 

What you really want to be worried about is Denial Of Service. If too many people use this webpage at the same time, apache will probably turn of because it is receiving too many requests too quickly. Google 'denial of service' for more info.

 

I think what you have to ask yourself is: does it really matter to the users if the data refreshes every second, or could it be every 10 seconds?

 

Also you could use ajax to just update the part of the page that was dynamic, rather then reload the whole page each time.

 

Robin

TBH I had a users online pahe that refreshed every 60 seconds and no-one complained, as soon as my site went down however, I recieved about 100 msn messages complaining. The way I see it, if you can't decide between two website features,BETA test them and compromise on the least popular.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.