MySQL_Narb Posted September 17, 2013 Share Posted September 17, 2013 I have a toplist site that allows users to submit their private game servers to my site. And one of the new features I plan on implementing is online status and uptime percentage. I have planned to make a cron that runs every 10 minutes that will go through each server registered in the database and update the online status (will have to attempt to make a connection to the server). And of course, after checking the status, set the status of the servers on my website to their online/offline results. On top of that, I will need to keep a record of the offline/online statuses every 10 minutes in a MySQL table, in order to calculate the uptime percentage Now, is there a more efficient way to do this? Won't having to make a connection to each server registered in our database be a major resource hog? Here's the stats of my VPS: . Number of CPU's: 1 CPU Speed: 1000MHz Memory: 1GB Disk Space: 10GB Bandwidth limit: 1TB Quote Link to comment https://forums.phpfreaks.com/topic/282210-most-efficient-way-to-calculate-uptime-for-servers/ Share on other sites More sharing options...
Solution vinny42 Posted September 17, 2013 Solution Share Posted September 17, 2013 Have you tested how much of a workload it really is to verify a server's status? I think you'll find that you can check dozens of servers per second because connecting to a server requires sending only a handfull of bytes of information and once sent, you can open another connection to another server while you are waiting for the first server to respond. Measure first, then optimize as needed, IF needed. Quote Link to comment https://forums.phpfreaks.com/topic/282210-most-efficient-way-to-calculate-uptime-for-servers/#findComment-1449817 Share on other sites More sharing options...
priyankagound Posted September 17, 2013 Share Posted September 17, 2013 Yes, actually there's several ways to do this. make sure you use the right data for the right consumer though, there is a difference. This link has a full article on it here, its called "Service Availability Reporting"http://themonitoringguy.com/articles/service-availability-reporting/ That should answer your questions.. Quote Link to comment https://forums.phpfreaks.com/topic/282210-most-efficient-way-to-calculate-uptime-for-servers/#findComment-1449818 Share on other sites More sharing options...
vinny42 Posted September 17, 2013 Share Posted September 17, 2013 Yes, actually there's several ways to do this. I'm pretty sure there is only one way to see if a service that you have no control over is up or not :-) But I think you misread the question. Quote Link to comment https://forums.phpfreaks.com/topic/282210-most-efficient-way-to-calculate-uptime-for-servers/#findComment-1449827 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.