From: SourceForge.net <no...@so...> - 2005-12-09 06:35:59
|
Feature Requests item #1365119, was opened at 2005-11-23 16:40 Message generated for change (Comment added) made by sdeasey You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719009&aid=1365119&group_id=130646 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C-API Group: Next Release (example) Status: Open Resolution: None Priority: 5 Submitted By: Paul Bukowski (shacky) Assigned to: Nobody/Anonymous (nobody) Summary: throttle inside nssock module?? Initial Comment: It would be interesting if navi could limit in/out bandwitch per vhost... or per outgoing ip address. ---------------------------------------------------------------------- >Comment By: Stephen Deasey (sdeasey) Date: 2005-12-08 23:35 Message: Logged In: YES user_id=87254 Hi Paul, I haven't looked carefully, but from within nssock I don't think you have enough information to throttle by virtual host, although you could probably do it by IP address. I guess there are a couple of reasons you might want to throttle bandwidth. As an ISP, you might want to limit each customer to some fraction of your bandwidth, depending upon their plan. You may also want to protect against DOS attacks, even accidental ones such as when someone tries to mirror your website. You have to be careful though. Even something as simple as limiting the bandwith per domain at an ISP can have unforseen consequences. For example, limiting the download rate will cause server threads to be tied up for longer than they otherwise would. It may have been possible to serve some file in a fraction of a second, but because you are limiting bandwidth, the thread which is writing the data is sleeping occasionaly. You can end up in a situation where all threads are busy serving data really slowly, refusing new connections and generally giving poor service to all, when in reallity the capacity of the server is much higher. Anyway, it's not clear what the best solution is, and I don't think that the standard nssock is the place to put it. nssock is only a couple hundred line of well commented code. I would suggest you copy it to nsthrottle, and start hacking. The thttpd web server has throttling code and is open source, so you could use that for inspiration. Jump on to the naviserver developers mailing list and we'll be glad to help you out. If you come up with something, we'll give you a CVS account and you can maintain your own module here if you'd like. Hope that helps. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719009&aid=1365119&group_id=130646 |