emmericp / MoonGen

MoonGen is a fully scriptable high-speed packet generator built on DPDK and LuaJIT. It can saturate a 10 Gbit/s connection with 64 byte packets on a single CPU core while executing user-provided Lua scripts for each packet. Multi-core support allows for even higher rates. It also features precise and accurate timestamping and rate control.
MIT License
1.04k stars 235 forks source link

Dynamic rate limiting #305

Closed danushkam closed 3 years ago

danushkam commented 3 years ago

Hello,

I need to change rate dynamically, based on a feedback received from a different (remote) process. Can MoonGen support (or be extended to support) something like that?

Thank you!

emmericp commented 3 years ago

We had some conference demo thingy with a web UI to control the rate, but I can't find it right now. Anyways, it's based on the integrated webserver, see https://github.com/libmoon/libmoon/blob/master/examples/webserver.lua

You can call the rate limit setter from a different thread in the callback of the webserver handler