Situation:
I got the page which shows all our servers (we name them resources). The list is obtained from MS SQL database. To show them I fetch them from array and echo. After echo - I send request to every resource to obtain its status (200, 404, 502 etc).
Problem:
When there was 10-20 resources the page loads few seconds, but now there are almost 100 resources (and will be more) therefor the page loads ~1 minute. And now my manager says we need to check status every 1 minute.
So, my question is - how can I achieve this? And generally - can I? :)
I don't need code or working solution, I need some guidance, how I can achieve this? What to search? What to read about? Maybe there is a solution with some library and even some framework that can do this better and simpler?
I have read some articles and questions on SO: http://www.w3schools.com/php/php_ajax_intro.asp Sending data from server to client? fetch data from text file and update web page every minute
And I think I need to learn about AJAX and use it. But any guidance I found was: Live Search, select something from input dynamically, suggestions when typing in field etc.
As I see it there must be a page like I have now servers.php
, when I load it it fetches and shows all servers. Then it call check_status.php
for every resource and updates data dynamically, then every 1 minute page reloads. But I don't understand how to send that much (~100) request to all servers in one time.
EDIT
We came to this: We will run Linux VM and run cron jobs to stay updated on our resources status. The script that check statuses with Ajax was simple to write as I haven't expected. For storing logs we will use MySQL database and will write simple pages to work with logs. Thank you all for participating in answers and comments!