|
Posted by burgermeister01@gmail.com on 08/23/07 17:12
On Aug 23, 9:54 am, FrobinRobin <frobinro...@hotmail.com> wrote:
> On 23 Aug, 15:37, "burgermeiste...@gmail.com"
>
>
>
> <burgermeiste...@gmail.com> wrote:
> > On Aug 23, 6:13 am, FrobinRobin <frobinro...@hotmail.com> wrote:
>
> > > Hi,
>
> > > I intend to use Ajax for a kiosk application, it's primary usage is to
> > > retrieve live data from my DB, it's a fairly small amount of data (5
> > > fields, of small data size and limited to 15 rows).
>
> > > When I check my server logs I can see that the kiosk page has used a
> > > fair amount of bandwidth this month, this is obviously because a
> > > javascript timeout refreshes the data every 10 seconds. What I need to
> > > know is how to calculate the bandwidth of the data for every ten
> > > seconds and then I can do the math to work out usage hours * bandwidth
> > > per hour.
>
> > > This is probably a fairly simple task but I've never done it before so
> > > any help would be much appreciated!
>
> > > Many Thanks
>
> > I'm not entirely sure that PHP is really the best solution to your
> > problem. There may be a method of measuring bandwidth with PHP, but
> > probably an easier way would simply be to use a network analyzer, for
> > example, Ethereal. However, such software has little to do with PHP
> > programming, so unless you still feel that PHP is the best solution,
> > further inquiries should be directed to a more fitting newsgroups.
>
> > Good luck!- Hide quoted text -
>
> > - Show quoted text -
>
> I just want to know how much data each ajax request is - I dont want
> to start messing around with third party apps.
> How about if I outputted the data to a file then used the filesize()
> function? Would that give me the correct data size per ajax request?
FrobinRobin,
I looked into your situation a little more, and as far as I can see,
directly, with PHP, there is no clear way to measure bandwidth usage.
However, something I overlooked, apache typically keeps an access_log
file which records all requests and the size of the data transferred
in requests. If you're using apache as your web server, reading from
that file is one possible solution. Other web servers may have similar
logs. I'm not sure if the file records the size of the headers sent
though, which is the same concern I have with what you purposed as a
solution, as well as what Jerry mentioned about binaries.
[Back to original message]
|