{"action":"created","issue":{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/804","repository_url":"https://api.github.com/repos/SnabbCo/snabbswitch","labels_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/804/labels{/name}","comments_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/804/comments","events_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/804/events","html_url":"https://github.com/SnabbCo/snabbswitch/pull/804","id":138759060,"number":804,"title":"snabbmark: Add \"mp-ring\" multiprocess benchmark","user":{"login":"lukego","id":13791,"avatar_url":"https://avatars.githubusercontent.com/u/13791?v=3","gravatar_id":"","url":"https://api.github.com/users/lukego","html_url":"https://github.com/lukego","followers_url":"https://api.github.com/users/lukego/followers","following_url":"https://api.github.com/users/lukego/following{/other_user}","gists_url":"https://api.github.com/users/lukego/gists{/gist_id}","starred_url":"https://api.github.com/users/lukego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukego/subscriptions","organizations_url":"https://api.github.com/users/lukego/orgs","repos_url":"https://api.github.com/users/lukego/repos","events_url":"https://api.github.com/users/lukego/events{/privacy}","received_events_url":"https://api.github.com/users/lukego/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/labels/merged","name":"merged","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"lukego","id":13791,"avatar_url":"https://avatars.githubusercontent.com/u/13791?v=3","gravatar_id":"","url":"https://api.github.com/users/lukego","html_url":"https://github.com/lukego","followers_url":"https://api.github.com/users/lukego/followers","following_url":"https://api.github.com/users/lukego/following{/other_user}","gists_url":"https://api.github.com/users/lukego/gists{/gist_id}","starred_url":"https://api.github.com/users/lukego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukego/subscriptions","organizations_url":"https://api.github.com/users/lukego/orgs","repos_url":"https://api.github.com/users/lukego/repos","events_url":"https://api.github.com/users/lukego/events{/privacy}","received_events_url":"https://api.github.com/users/lukego/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2016-03-06T06:24:11Z","updated_at":"2016-03-16T05:26:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/pulls/804","html_url":"https://github.com/SnabbCo/snabbswitch/pull/804","diff_url":"https://github.com/SnabbCo/snabbswitch/pull/804.diff","patch_url":"https://github.com/SnabbCo/snabbswitch/pull/804.patch"},"body":"Add a new `mp-ring` benchmark for measuring the performance of basic multi-process link operations. The benchmark forks worker processes and cycles packets through them via a series of links.\r\n\r\nThis particular benchmark \"just works\" in multiprocess mode without any changes to the Snabb core because packets and links are already allocated in shared memory, that is done before the children are forked, and freelists are not used because the same packets keep circulating from link to link.\r\n\r\nThe intention of this benchmark is to be a framework for investigating any fundamental performance limits of inter-process traffic (see #801) and for reproducing specific issues like inter-core conflicts on the cache-coherence level. The code uses a simple and naive Lua implementation (\"basic\") but can accommodate more sophisticated implementations (in the spirit of the asm code in #603). This could make it a useful tool for prototyping code like 100G mux/demux (#691).\r\n\r\n(I have made no attempt to optimize this benchmark. That is another activity entirely.)\r\n\r\ncc @xrme @kbara\r\n\r\n#### Examples\r\n\r\n```\r\n[luke@lugano-1:~/git/snabbswitch/src]$ make && sudo ./snabb snabbmark mp-ring --processes 1\r\nmake: 'snabb' is up to date.\r\nBenchmark configuration:\r\n       burst: 100\r\n  writebytes: 0\r\n   processes: 1\r\n   readbytes: 0\r\n     packets: 100000000\r\n        mode: basic\r\n   pmuevents: false\r\n  65.28 Mpps ring throughput per process\r\n\r\n[luke@lugano-1:~/git/snabbswitch/src]$ make && sudo ./snabb snabbmark mp-ring --processes 2\r\nmake: 'snabb' is up to date.\r\nBenchmark configuration:\r\n       burst: 100\r\n  writebytes: 0\r\n   processes: 2\r\n   readbytes: 0\r\n     packets: 100000000\r\n        mode: basic\r\n   pmuevents: false\r\n   5.44 Mpps ring throughput per process\r\n\r\n[luke@lugano-1:~/git/snabbswitch/src]$ make && sudo ./snabb snabbmark mp-ring --processes 3\r\nmake: 'snabb' is up to date.\r\nBenchmark configuration:\r\n       burst: 100\r\n  writebytes: 0\r\n   processes: 3\r\n   readbytes: 0\r\n     packets: 100000000\r\n        mode: basic\r\n   pmuevents: false\r\n   4.39 Mpps ring throughput per process\r\n```\r\n\r\n#### Usage\r\n\r\n````\r\nUsage:\r\n  snabbmark mp-ring [OPTIONS]\r\n\r\n  -m MODE, --mode MODE\r\n                             Mode of operation. Determines which code\r\n                             is used for the worker processes.\r\n                             Currently supported values:\r\n                               basic -- idiomatic Lua code [default]\r\n  -n PROCESSES, --processes PROCESSES\r\n                             Number of worker processes.\r\n                             Default: 2\r\n  -p PACKETS, --packets PACKETS\r\n                             Number of packets processed by each worker.\r\n                             Default: 100e6 (one hundred million)\r\n  -b BURST, --burst BURST\r\n                             Initial number of packets per link.\r\n                             Default: 100\r\n  -e EVENTS, --events EVENTS\r\n                             Comma-separated list of PMU events to count.\r\n  -r BYTES, --read BYTES\r\n                             Number of bytes to read from each packet.\r\n  -w BYTES, --write BYTES\r\n                             Number of bytes to write to each packet.\r\n  -h, --help\r\n                             Print this usage message.\r\n````"},"comment":{"url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/comments/197159093","html_url":"https://github.com/SnabbCo/snabbswitch/pull/804#issuecomment-197159093","issue_url":"https://api.github.com/repos/SnabbCo/snabbswitch/issues/804","id":197159093,"user":{"login":"lukego","id":13791,"avatar_url":"https://avatars.githubusercontent.com/u/13791?v=3","gravatar_id":"","url":"https://api.github.com/users/lukego","html_url":"https://github.com/lukego","followers_url":"https://api.github.com/users/lukego/followers","following_url":"https://api.github.com/users/lukego/following{/other_user}","gists_url":"https://api.github.com/users/lukego/gists{/gist_id}","starred_url":"https://api.github.com/users/lukego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukego/subscriptions","organizations_url":"https://api.github.com/users/lukego/orgs","repos_url":"https://api.github.com/users/lukego/repos","events_url":"https://api.github.com/users/lukego/events{/privacy}","received_events_url":"https://api.github.com/users/lukego/received_events","type":"User","site_admin":false},"created_at":"2016-03-16T05:26:11Z","updated_at":"2016-03-16T05:26:11Z","body":"Interesting! Please push that crude sleep somewhere e.g. your `mp-ring` branch so that it will show up over on #813. Seems simple if we keep using that branch and PR for discussion. I will merge it up to `multiproc` whenever that makes sense.\r\n\r\nI wonder if `movnt` would also avoid this ping-pong overhead. Curious to look at the PMU counters for this when I have a chance to understand the exact MESIF interaction."}}