Closed Thread
Results 1 to 12 of 12




  

Thread: How to calculate server bandwidth usage

      
  1. #1
    I'm New! PHP Programmer is on a distinguished road
    Join Date
    August 1, 2007
    Posts
    8
    Rep Power
    0
    Feedback Score
    0

    Default How to calculate server bandwidth usage

    Hi,
    I am working on a video site and need to calculate few things;

    1. how to check , if the video has been played or not (after loading the page)?
    2. How to calculate bandwidth used by user?

    I hope to get your help.

    Thanks !

  2. #2
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    What method of deployument are you using to play the video's? if it is flash then you could always send a response to a backend file when the play button is clicked that will just increase a counter

    as for bandwidth can you explain more in depth what you are trying to achieve
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  3. #3
    I'm New! PHP Programmer is on a distinguished road
    Join Date
    August 1, 2007
    Posts
    8
    Rep Power
    0
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    I am retrieving the video file (flv) from the db and passing to the player. then player runs the video. I am using embed code to run the video and site is in php, so I need php script to calculate the bandwidth.

    Also, when the script generates a dynamic embed script, for the certain flv,file, counter is also modified in db.

    i hope this is what you asked.

    I look forward to get your help.

  4. #4
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    well kind of lol so you are using either php or javascript to output the dynamic video, does the video play from the start, is it a standard flash player or a custom one.

    As for bandwidth you meantioned user you can easily get the bandwidth usage for a site from cpanel if you have it, if not then whatever alternative your hosting service uses should tell you
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  5. #5
    I'm New! PHP Programmer is on a distinguished road
    Join Date
    August 1, 2007
    Posts
    8
    Rep Power
    0
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    I am using both php and javascript. I know about cpanel. But I need to calculate used bandwidth by my self.
    let me know, if you know, how to calculate it?

  6. #6
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    If the operating system is linux then you would use iptables i beleive, but it depends on who is hosting you as to if you have access or not
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  7. #7
    I'm New! PHP Programmer is on a distinguished road
    Join Date
    August 1, 2007
    Posts
    8
    Rep Power
    0
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    Is there any way, I can write my own script to calculate the band width, only used for video playing???????

  8. #8
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    hmmmm well I cant think of a way to have it 100% acurate however if you are fetching the video's dynamicly and your increasing the counter then there is no reason why in that same file you couldn't manaually update a field somewhere that will add the size of the video to a value.

    so you would have your videos stored in a database i presume just add a filesize field and add that onto the current video bandwidth usage stored in another table.

    thats the only way I can see you doign it
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  9. #9
    I'm New! PHP Programmer is on a distinguished road
    Join Date
    August 1, 2007
    Posts
    8
    Rep Power
    0
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    I already know this. This is not 100% accurate. what if you just open the page, it give you one hit to your counter, but you run only 50% of the file and close the page.

    In this case you have 100% bandwidth. However you used only 50%. I want this accurate. not a wild guess.

  10. #10
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    sadly there wont be an accurate figure, the reason for that is the only way to calculate it would be in the flash player and sending the filesize downloaded.

    But you also need to take into account that the file is streamed meaning the person could only have watched 20% of the video but have the entire video downloaded.

    So again the only way really is to do an educated guess the flash player could send the number of bytes downloaded to a backend php file but thats a lot of cummunication for the server to handle.
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

  11. #11
    Grand Masters grim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond repute grim's Avatar
    Join Date
    September 22, 2006
    Posts
    10,060
    Rep Power
    25
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    Raw log files?

  12. #12
    Jedi Master Paramiliar is on a distinguished road Paramiliar's Avatar
    Join Date
    July 24, 2007
    Location
    West Midlands
    Posts
    105
    Rep Power
    5
    Feedback Score
    0

    Default Re: How to calculate server bandwidth usage

    I thought about that but figured he would have the same problem as again the file is streamed
    Matthew Bagley
    Paramiliar Design Studios
    IT Consultant | Website Design | Website Development

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. How much bandwidth do you use monthly?
    By pr0p3R in forum Web Hosting
    Replies: 23
    Last Post: Oct 16th, 2006, 12:19 pm
  2. Replies: 4
    Last Post: Nov 9th, 2004, 12:02 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads