I am working for mobile system, the web service is yaws!
In this system, we need to upload and download the file in the wireless environment.
so it is a must to limit to the num of uploading and downloading the doc in one minute
considering of the load of the server. In this way, we need to have a filter that can filter
the following http request ,and decide whether this upload or download will go on.
Importantly, this action must be executed before the server finish receiving the
request data, It is a strategy to decrease the load of our application server.
I spent all day to reading the yaws 1.93 configure document, but I find nothing
about this function. How do I do it ?
Thank you for the wonderful software.
If you need to reject all requests when the server is loaded, you can use a shaper to throttles HTTP requests. To do so, you must write a module that implements the behaviour "yaws_shaper". Checks will be done just after headers are received.
By using an Appmod, you could handle downloads and uploads and track how many requests are in progress.
If you want a more fine filtering, a better solution would be to rewrite the request by defining an "arg_rewrite_mod" module. Here, checks will be done after the first chunk of data is received (by default 10240 Bytes).
thanks for your advise！