开发者

Track User Bandwidth With PHP Application

开发者 https://www.devze.com 2023-04-05 04:54 出处:网络
I\'m working on campus project using PHP and CodeIgniter. It\'s only a project for my assignment. Then it comes that i have to limit bandwidth used by user (of app, not linux user).

I'm working on campus project using PHP and CodeIgniter.

It's only a project for my assignment.

Then it comes that i have to limit bandwidth used by user (of app, not linux user).

And i have no idea to implement this.

I wonder if someone know the logic or ever work on the similar tasks.

What basically i need is, how to track that user (system user, not linux user) bandwidth?

Should i count every r开发者_开发百科equests and responses for that user?

How to count for imagse and static files download for specific user system?

Any hints is greatly appreciated.

Thaks

Ivan


One of the only ways I can think of (using php) is to parse the access.log of the webserver, and add up the bandwidth for each client.

The next time a page is loaded and the client has reached a set limit you can then run what ever code you want.

Parsing the log each page load though does seem like it would be time consuming.

Thats how some website statistic programs get that info.

EDIT

Also some log files get archived at certain points, like mine gets a fresh start every Sunday at 6am so if a user was browsing during that time, their access history would disapear after 6, so saving the clients bandwidth in a database is a way to keep that information all the time

0

精彩评论

暂无评论...
验证码 换一张
取 消