Configuring a Traffic Rate Limit Identifier
To configure a traffic limit identifier from the command line interface
add ns limitIdentifier <limitIdentifier> -threshold <positive_integer> -timeSlice <positive_integer> -mode <mode> -limitType ( BURSTY | SMOOTH ) -selectorName <string> -maxBandwidth <positive_integer> -trapsInTimeSlice <positive_integer>
Argument description
-
REQUEST_RATE. Tracks requests/timeslice.
-
CONNECTION. Tracks active transactions.
-
Smooth: Spreads the load evenly across each time slice of the set time frame. Use for application traffic that is consistent.
-
Bursty: Allows the requests to pass through if the load is below the set threshold. Use for application traffic that is sporadic. It is helpful if the load peaks anytime within the set time frame.For example, the set maximum requests are 100 and the time frame is 10 seconds. If your application receives 80 requests in the first second, these limit types behave differently. The bursty limit type allows the requests to pass through because the load is below the set threshold. However, the smooth limit type allows only 10 requests per second. So, it applies the configured action for the excess load.
add ns limitIdentifier 100_request_limit -threshold 100 -timeSlice 1000 -mode REQUEST_RATE -limitType BURSTY -selectorName limit_100_requests_selector -trapsInTimeSlice 30
add ns limitidentifier limit_req -mode request_rate -limitType smooth -timeslice 1000 -Threshold 2000 -trapsInTimeSlice 200