Re: Asynchronous SNMP?
| From: | Richard Lynch | Date: | Sat, 01 Sep 2001 00:36:42 +0000 |
| Subject: | Re: Asynchronous SNMP? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-65571@lists.php.net to get a copy of this message | ||
You can run 5 or 6 copies of PHP just fine, way easier than trying to hack
together some sort of multi-threading inside of PHP. Just be sure you use a
database or other thread-safe storage mechanism. Writing to a common file,
for example, would be pretty bad. Actually, under Linux, for small data
blocks (4k?) you can safely use fopen(,'a');fwrite();fclose()
How that compares to doing the thing in C++ depends a little bit on your
relative strengths in C++/PHP, but you'd have to a be a multi-threading C++
guru and a total newbie to PHP for the C++ solution to be easier.
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Robert Schultz <bert@ncinter.net>
Newsgroups: php.general
To: <php-general@lists.php.net>
Sent: Thursday, August 30, 2001 7:11 AM
Subject: Asynchronous SNMP?
> I'm working on a project that involves a lot of SNMP data gathering.
> I was wondering if it's possible to have a multi-threaded PHP script.
> Basically the SNMP queries I'm running are taking a long time to complete
> (several seconds). However I found that running multiple at the same time
> does not slow down the response time of any of the others. So I was
> wondering how easy it would be to get 5 or 6 SNMP queries running at the
> same time.
>
> If PHP is unable to, I'm going to have to write a C/C++ app, that will do
> it, then insert the results into a database. Then the PHP script will grab
> from there.
>
> Any suggestions?
>
> --
> Robert Schultz - robert.schultz@adelphiacom.com
> Knowledge Engineer - Adelphia Communications
>
>