Robert G
Feb 13 2006, 06:18 PM
Hi there,
I have a page that queries a bunch of routers and wireless access points through SNMP. The problem is that the page queries about 500 devices sequentially and takes about 2 minutes to load in peak hours. I was thinking that there must be a way to query all devices simultaneously (or at least in batches) to trim down the page loading time.
Do you guys have any ideas? I would really appreciate your help!
Thanks,
Robert
sjthomas
Feb 20 2006, 11:25 PM
Not really my area of expertise but one thing I would suggest would be to have two versions of the page. On one you could warn the user that it may take a while to query all the routers. For the other you could set up a cron job (or maybe have it triggered after a certain number of views etc) to check the routers, store them locally and then just display those results to the visitors. You'd have to warn them that the information is, say, 10 minutes old but if you give them the option to view the current info, with the caveat that it may take a while, it should be OK. You see this approach with sites that, for example, list proxies and suchlike, to get the info to the user quickly its often slightly out of date hence you get reminders like "Last checked 23 minutes ago" etc.
Hope that helps. Just out of interest, what are you using it for?
Robert G
Feb 21 2006, 04:20 AM
Thanks for the suggestion - this is sort of what I have right now, but I was hoping that there is another way to do it.
I'm using the page to monitor a wi-fi network (access points, access controlers, radius servers, etc.). I looked on the web for something like that, but I cannot find anything which would allow me execute two (or more) functions simultaneously, rather than consequtively.
Robert G
Feb 24 2006, 02:41 PM
Hey guys,
I found a very roundabout way of doing it, but it definitely does the trick: I included several dummy inline frames which invoke a PHP script that does a certain proportion of the total number of queries (executed simultaneously). The results from the queries are saved in a temporary file. Then I have a script that simply waits until all the information has been collected, sorts it, and displays it in the way I want.
Just thought it might be useful

Thanks,
Rob
sjthomas
Feb 24 2006, 10:58 PM
QUOTE(Robert G @ Feb 24 2006, 02:41 PM) [snapback]33281[/snapback]
Hey guys,
I found a very roundabout way of doing it, but it definitely does the trick: I included several dummy inline frames which invoke a PHP script that does a certain proportion of the total number of queries (executed simultaneously). The results from the queries are saved in a temporary file. Then I have a script that simply waits until all the information has been collected, sorts it, and displays it in the way I want.
Just thought it might be useful

Thanks,
Rob
LOL that is a very roundabout way of doing, but clever nonetheless. I can't seem to get rid of a nagging doubt i n my head that says theres a better way of doing this. Have you thought about a kind of backwards load balancing script or something? Just something that works in real time but distributes the workload?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.