Diego Giagio wrote:
> This is the first version of the traffic shaping patch for cherokee.
> It's not yet finished but the main part is already working. To
> enable the shaping one can use the 'Limit' directive on the config
> file either on global scope or Server scope. Eg.
>
> Limit 100
>
> The yacc grammar doesn't yet understand the unit. Today it defaults
> to kilobytes. On the future it'll be possible to specify megabytes
> and gigabytes (Eg. 1000M or 100G)
>
> The algorithm used to control the bandwidth was a simple FIFO. I
> think it fits best cherokee among other complex algorithms.
Good stuff!! The patch looks really good :-)
> Feel free to give any suggestions, ideas, criticism, etc.
I have only one comment..
> +ret_t
> +cherokee_throttler_wait (void)
> +{
[..]
> + ts.tv_sec = 0;
> + ts.tv_nsec = nsec;
> + nanosleep (&ts, NULL);
> +}
We should not even think of sleep inside a thread of the server.. it
is generating a potential DOS problem and will decrease the server
performance.
Have you think of returning a ret_eagain? It is not neither the
perfect solution (because it will more CPU hungry), but I think it
is fair enough by the moment.
--
Greetings, alo.
http://www.alobbs.com
_______________________________________________
Cherokee mailing list
[email protected]
http://www.alobbs.com/cgi-bin/mailman/listinfo/cherokee