Nojan
Nojan

Reputation: 913

PHP and webserver integrating

i wrote a simple script in php which handles the users and their access to the content. the last thing i want to do is to write a module to dynamically limit the download speed and maximum number of connections for each group of users when they attempt to access the files on server. something like this:

Usergroup0: [max conn num: 2] [max connection speed: 256kb/sec]
Usergroup1: [max conn num: 4] [max connection speed: 1mbit/sec]
Usergroup2: [max conn num: 8] [max connection speed: 1mbit/sec]

right now i have no clue how it's done.. i want to know what technique (or module) is it so i can look it up. any hint or guidance would be great.

Upvotes: 0

Views: 70

Answers (1)

user1477388
user1477388

Reputation: 21440

I have never heard of such a thing myself. This should help with the limiting download speed How to limit speed of outgoing response from php script?

For limiting the number of connections (I assume you mean simultaneous connections), you could just associate a "connected" status with the currently logged in user in the database and run a script to check whether or not the maximum number of users the group which the current user is a member of has been breached.

Edit: Regarding limiting download speed, from the SO article, this was a good resource http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs%3aTrafficShaping#Selective-traffic-shaping-plugin15-svn

Upvotes: 1

Related Questions