- 註冊時間
- 2001-8-3
- 線上時間
- 1058 小時
- 閱讀權限
- 255
- 積分
- 3673
- 主題
- 270
- 精華
- 1
- 文章
- 7360
該用戶從未簽到 - 文章
- 7360
|
回覆: 【討論】Apache 可否作資料夾限速?
阿輝 wrote:
apache 有特定資料夾下檔案限速、線不能分割下載之類的功能ㄇ?
就是別人抓檔的時候會有速度限制~~ 只能單線裎下載.. 5k... 例如這樣~
相關連結:
http://www.apache.org/dist/httpd/contrib/modules/1.2/
http://www.apache.org/dist/httpd ... /mod_simultaneous.c
* mod_simultaneous.c
*
* Michael Davon 10/95 (davon@web-depot.com)
*
* Limit the number of simultaneous accesses to files in a
* particular directory. Allow servers to wait for access.
*
* Using this module will increase the load on the server, since
* it will do a fair amount of file access to manage the locks.
* However, this module is quite effective at limiting access.
*
* This is particularly useful if you only have so much bandwidth
* on your network connection, and don't want it all sucked up
* by people looking at pictures.
*
* Note that when servers are waiting for access, they wake up
* once per second, and try again for access. There is no queue, so
* whichever waiting process wakes up first (when access is available)
* gets the access. Queuing would be nice, but is hard to implement.
*
* An effective strategy to limit bandwidth consumption may be
* as follows:
*
* SimultaneousAccesses 1
* SimultaneousWait 4000
* SimultaneousValidate 10
*
* This will have the effect of allowing only 1 access to a directory at a
* time, however, it will keep the server waiting until it finally does
* get access (up to 4000 seconds), and it will validate the locks every
* 10 seconds, just to make sure the locking process is still around.
*
* Setting "SimultaneousAccesses 0" allows unchecked access.
*
* Setting "SimultaneousWait 0" will not wait, and will timeout
* immediately if there is no slot available.
*
* Setting "SimultaneousValidate 0" will never validate the slots.
*
* Setting "SimultaneousValidate 1" will validate the slots every second.
*/
http://www.apache.org/dist/httpd/contrib/modules/1.2/mod_limit.c
* mod_limit.c: limits on daily usage by users
* A user can only xfer so many bytes/period.
*
* Sameer Parekh
|
|