Im Jake Posted June 13, 2008 Share Posted June 13, 2008 thats my php script, it takes 1 second to ping each server, well my webhost times out after 30-45 seconds, so after that long it times out after i get 30-45 servers on the status page, how can i make it so that it will do it quicker or ping more servers every second? <?php include("includes/connection.inc.php"); $results = @mysql_query("SELECT id, name, ip, port, uptime, status FROM servers") or die(); while($values = mysql_fetch_array($results)){ list($online, $offline) = explode(',', $values['uptime']); $socket = @fsockopen(stripslashes($values['ip']), stripslashes($values['port']), $errno, $errstr, 1); if($socket){ $status = 'online'; $online = intval($online) + 1; } else{ $status = 'offline'; $offline = intval($offline) + 1; } $uptime = $online . ',' . $offline; echo 'Server: ' . $values['name'] . ' is ' . $status . '<br />'; $resultsUpdate = @mysql_query("UPDATE servers SET uptime='$uptime', status='$status' WHERE id=" . $values['id']) or die(); } $time = time(); $resultsTime = @mysql_query("UPDATE config SET lastupdate='$time'") or die(); ?> Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/ Share on other sites More sharing options...
DarkWater Posted June 13, 2008 Share Posted June 13, 2008 You can try paginating it after every 20 servers to be safe. Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/#findComment-565288 Share on other sites More sharing options...
Im Jake Posted June 14, 2008 Author Share Posted June 14, 2008 You can try paginating it after every 20 servers to be safe. how would i do that Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/#findComment-565294 Share on other sites More sharing options...
Im Jake Posted June 14, 2008 Author Share Posted June 14, 2008 Hello?!!??!?! Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/#findComment-565679 Share on other sites More sharing options...
Im Jake Posted June 16, 2008 Author Share Posted June 16, 2008 been 3 days... Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/#findComment-566783 Share on other sites More sharing options...
Jabop Posted June 16, 2008 Share Posted June 16, 2008 In the last 3 days, did you try: http://www.google.com/search?hl=en&safe=off&client=firefox-a&rls=com.ubuntu%3Aen-US%3Aunofficial&hs=dH0&q=paginating+mysql+php&btnG=Search Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/#findComment-566789 Share on other sites More sharing options...
hitman6003 Posted June 16, 2008 Share Posted June 16, 2008 or ping more servers every second Use fping...http://fping.sourceforge.net/ Link to comment https://forums.phpfreaks.com/topic/110151-timing-out/#findComment-566792 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.